​​
​​On Sat, Feb 14, 2015 at 12:50 PM, gatesphere <gatesph...@gmail.com> wrote:

​> ​
@auto-md is useful for the same reasons.  And afaik, is completely
undocumented.

​Thanks for this heads up.  I'll make sure all flavors of @auto-*​ are
documented for 5.1.   For sure, @auto will remain for the foreseeable
future.

This is turning into a fascinating discussion, as I'll now explain.

It may be relatively easy to make @nosent do the work of @auto-rst and the
rest (@auto-*) This will involve special cases to the @nosent read and
write logic.  These special cases should be relatively straightforward.

**Terminology**: @ns-* denotes @nosent augmented with special read/write
code for rst, md, vimoutline and otl (Emacs outlines).  We may not need
different flavors to the @nosent directive, but that's another question.

===== @ns-* write logic

In his initial post, Rob said, "when I change my @auto-rst files to @nosent
files, the resulting files do not contain the RST section headers that were
automatically added by @auto-rst."

This proves that @ns-rst must have special logic that writes the proper
section headers.  Happily, this can be done easily with special cases in
at.putOpenNodeSentinel.  Ditto for @ns-md, @ns-vimoutline and @ns-otl.

===== @ns-rst read logic

No change is actually *required* for @ns-rst and @ns-md. When reading an
@ns-rst or @ns-md file, added sections could be slurped into the outline as
under/overlining text.  The user could leave the changed node as it is.  Or
the user could create a new node with the indicated headline.  Either way,
the @ns-rst write logic would recreate the changed file.

However, a simple, fast post-pass in the @ns-rst/md read logic could create
the new nodes automagically. The post-pass would traverse the tree created
by the @nosent logic looking for under/overlined lines (or # lines for md),
creating new nodes as needed.  The actual code would be similar to the
@auto-rst logic,but it exists in a far simpler context than @auto-rst.

Post passes are probably *required* for @ns-vimoutline and @ns-otl. Indeed,
vimoutline or otl sentinels should *never* be left as plain text in an
existing node.  The "raw" sentinels would corrupt the vim or Emacs outline
if the node were later moved.  An unpleasant time bomb.

===== Summary

@auto-* will remain for the foreseeable future.  This post has been
discussing new features.

I'll investigate adding @ns-* logic.  The write code is trivial; the read
post-pass should be simple, straightforward, and similar to corresponding
@auto sentinel-recognition code.

Your comments, please.

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
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