We have problem with @ and @c directives. For most languages I can think of 
it would suffice if Leo just replace those blocks, along with directives, 
with properly block commented text. But for @rst  files those blocks are 
used for special @rst-options. 

What if Leo before writing Leo-outline replaces those lines with actual 
content they would have in target file, and put some special mark in uA for 
such nodes. When reloading from disk later, Leo would not find those lines 
different from the related lines in body content. After reloading Leo 
should simply walk the whole tree and wherever finds special uA replaces 
commented lines accordingly with block surrounded with @ and @c.

For example if a node that is part of @nosent tree,  with the following 
body, should be written:

@
  Test comment
  another line of comment
@c
def test(n):
    print(n)

Leo would immediately before saving outline, replace the content of the 
body with the following:

#  Test comment
#  another line of comment
def test(n):
    print(n)
and in uA of the node it would add an attribute 'at-comment-block', 
something like:
p.uA['at-comment-block'] =((0,2),)

Then after loading outline, it would search for 'at-comment-block' 
attribute and wherever it finds it, it would insert '@' and '@c' at 
specified positions, while removing comment delimiter from inside lines.

My 2 cents
Vitalije

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to