I wouldn't change the save logic, I'd just execute "save" for the full .leo
document when

- Node has changed in external editor.
- The node that changed is the only dirty node in the whole leo document.

I don't use xemacs/vim plugin, but rather "edit in" in right click menu
(contextmenu.py plugin IIRC).

I agree that this is not an elegant proposal, in that it involves a
potentially surprising (if useful) special case.

I have to think this a bit more. Perhaps some kind of extra warning in the
UI for this scenario would do the trick as well.




On Thu, Nov 29, 2012 at 1:44 PM, Edward K. Ream <[email protected]> wrote:

>
>
> On Tue, Nov 27, 2012 at 3:38 AM, Ville M. Vainio <[email protected]>wrote:
>
>
>> After discovering sublime edit, I have started using external editor mode
>> more (rclick -> Edit in...). Annoyance there is that once you save in
>> external editor, you still have to go to leo and save there, or your
>> changes will be lost if you close leo without saving.
>>
>> This can lead to loss of date if you don't routinely agree to save
>> changes when closing Leo. I often don't do this, as I save all the time
>> when I type, and don't want to save accidental changes I might have done to
>> the leo document; I don't usually have time to review changes when closing
>> a document.
>>
>> Maybe .leo could automatically save the tree if and only if the
>> externally edited node is the only dirty one.
>>
>
> I agree there is a problem, but I don't believe hacking Leo's save logic
> is a good idea, for several reasons:
>
> 1. There might be several dirty nodes, and you could still lose data
> (strictly following your suggestion) in that case.
>
> 2. The write logic for external files is complex, mainly due to file
> caching.  I tolerate that complexity because caching is such a big win.
> But it would not be easy to do @file AI to discover the special case you
> mention.
>
> 3. Imo, the proper place to handle this problem is in the vim and xemacs
> plugins.  These plugins are responsible for the interaction with Leo.
>
> Would it work for you if the xemacs and vim plugins automatically saved an
> external file whenever the plugin caused a node in that file to become
> dirty?  This would likely solve the problem you mention, although I
> wouldn't be my life on it.
>
> Your comments, please.
>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/leo-editor?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to