On Thu, Nov 29, 2012 at 6:30 AM, Ville M. Vainio wrote:

> 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).
>>
>
> Ok.  In that case the contextmenu plugin should handle this. 
>

I believe that c.openWith should be able to deal with this problem.  
c.openWith creates a temporary external file and updates a node when the 
user changes that file.  This logic is independent of the editor being 
used; it works, for example, with Scite, my default external editor.

Clearly, c.openWith (or rather, one of its helpers) is able to update the 
node and to mark it dirty.  So at the time the node is marked dirty 
c.openWith has an opportunity to automatically save the file containing the 
vnode.  c.openWith can issue a colored message to the log pane, but that 
should be the only "warning" necessary.

My present plan is to write a helper, say c.write_vnode, that will discover 
the external file (if any) containing the vnode, and immediately write that 
external file *without* a prompt.  If there is no external file, 
c.write_vnode could just do an ordinary save of the .leo file and all dirty 
external files.  Alternatively, c.write_vnode could write only the .leo 
file (the write-outline-only command) *without* clearing the c.changed bit.

I believe c.write_vnode will solve this problem fairly completely.  What do 
you think, Amigos?

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/leo-editor/-/rS1KLCE1vEMJ.
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