On Tuesday, November 21, 2017 at 9:46:12 AM UTC-6, Edward K. Ream wrote:

I'll play with declutter today. If it works as I expect it will I'll remove 
> all the code affected by deleting org-mode tags.
>

This is the first time I have used declutter, and I think this is going to 
handle org-mode tags very well.

Declutter is completely optional because it requires @bool tree-declutter = 
True.

The body text of @data tree-declutter-patterns determines what gets 
decluttered. For my test I used the following rule:

RULE ^([^:]*):([\w_@]+:)+\s*$
REPLACE \1

There are two parts to the regex.  The head ^([^:]*) (\1) is retained. The 
tail :([\w_@]+:)+\s*$ contains all the tags.

The regex is subtle, and not perfect:

1. The tail will match :tag1:tag2: but *not* :tag1: :tag2:
2. The entire pattern will fail if colons appear in the head.
3. The entire pattern will fail if anything besides whitespace follows the 
tags.

It's not easy to see how to improve the regex.  For example, replacing 
^([^:]*) by ^([^:]*) does not work, as you can see for yourself on the regex 
testing page <https://pythex.org/>. I invite all you regex gurus to suggest 
improvements.

Unless I hear objections, I am going to comment out the code in the org 
mode reader and writer that inserts or delete tags.

All comments welcome.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to