I have spent all morning futzing with an annoying problem related to 
Shift-Ctrl-W (write-at-file-nodes).  After much experimentation I have an 
elegant solution.  This is now on the repo: please report any problems 
immediately.

The original problem was that the Shift-Ctrl-W didn't clear dirty bits in 
@auto trees, and also marked a previously-unchanged .leo file as marked!

It took awhile to realize that the @auto write code alters the @persistence 
tree, so the .leo file *should* be changed ;-)  There is no easy way for 
the persistence code to know whether the "before" and "after" versions of 
the persistence tree would actually be the same. After *much* 
experimentation with more complicated schemes I have found an easy way:

If *only* the persistence tree remains unchanged after the 
write-at-file-nodes command, Leo will automatically save the .leo file.  If 
there are *other* dirty nodes outside the @persistence tree, Leo will not 
presume to automatically save the .leo file.  This policy is safe, 
convenient and reasonable.  Leo users will mostly not even know the policy 
is in place, which is the best kind of policy.

Here is the checkin log for rev a1439e3...

QQQ
Added some tricky code to clear dirty bits in @auto trees after the 
write-at-file-nodes command.

An important Aha: the new code writes the .leo file (thereby writing 
changed persistence data), but *only* if there are no *other* changed nodes 
outside the persistence tree. Otherwise, neither the persistence data nor 
the still-unwritten dirty nodes are written, and the .leo file remains 
dirty.

This could be called a compromise, but it is much better than several other 
alternatives I tried today.
QQQ

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

Reply via email to