On Mon, Dec 30, 2013 at 11:16 AM, Edward K. Ream <[email protected]>wrote:

===== Creating and updating these nodes.

>
> The user could update these data by hand, but commands such as
> create-organizer-node and delete-organizer-node could create @organizer
> nodes automatically.  Even these commands are a bit clumsy, but I see no
> alternatives.
>

There is an easy way that does everything automatically.

The controller class will define two methods: update_before_write and
update_after_read, to be called before reading a .leo file and after
writing a .leo file.  (Similar methods will be called when reading and
writing individual @auto files).

update_before_write will discover all organizer nodes and will update all
@organizer nodes appropriately.  For this purpose, we define an organizer
node is any node with children whose body text is either empty or contains
nothing but but comment lines and blank lines.

update_after_read recreates organizer nodes from @organizer nodes and also
creates cloned nodes from @clones nodes.  It would be possible for this
post pass to move leading comment lines from the first child of the
organizer node into the organizer node.  Or something like this: just now
I'm not sure where the importers place comments that appear before class
and def nodes.  It's a small point just now.

This concludes the design of @auto-view.  It's time to start coding.

Edward

P.S.  Several years ago Ville made the comment that it's too easy to change
node order when using Leo in a collaborative environment.  This may be the
time to raise a warning dialog when the user tries to sort nodes in an
@auto tree.  A user option should exist to suppress this dialog, but I do
think it should be a little less easy to rearrange blocks of text in @auto
trees.

EKR

-- 
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/groups/opt_out.

Reply via email to