That is very good advice. I am thinking a good starting point is to focus on supporting editing of @auto files in Emacs. Is it possible to have Leo expose an interface for parsing and editing @auto nodes? Here is the usage pattern:
In Emacs open a file as usual. A command will then starts Leo in a Python sub process and send the buffer to Leo to compute the node structure. Take the node structure returned from Leo and display it in a Emacs tree buffer. Tree buffer can then be used for navigation. Use Emacs visibility control to display nodes in the edit buffer as desired -- we could hide all nodes not in focus or optionally show more context nodes (this could potentially be richer than the current Leo Qt GUI). Text editing is done as normal in Emacs. Outline editing will be done through Leo. To edit the outline, Leo node will have to be mapped to Emacs buffer line numbers and node operations into Emacs line/region edits. So moving a node, e.g., can be translated into appropriate kill and insert of the corresponding text in the Emacs buffer. Indentation level in Emacs shouldn't be changed based on node visibility so as not to mess with the undo tree. This could require extra translation when updating Leo with text changes. Keeping Emacs and Leo in sync can be tricky: as we edit text in Emacs do we figure out which node we are editing and update Leo just on that node? This would require more intelligence on the Emacs side if we make more than one nodes visible at a time -- or we have to limit visibility to one node only so we always know which node is being edited and update Leo with changes whenever nodes are switched. Or alternatively we can ask Leo to recompute the whole outline structure again whenever line numbers are changed, potentially a performance hit. The best way to start is probably to imitate Leo body pane and show one node a time in the Emacs buffer. Scripting can be done in a separate buffer. Since we do text editing in Emacs scripts should not touch body text and should only work on the outline structure. Basically Leo is used to compute and maintain the outline structure for a single file and run scripts if necessary. As a starting point I think this is fairly clean but it does require Leo to support the concept of working with just an @auto sub outline instead of with a whole outline. On Wednesday, October 17, 2012 5:18:57 AM UTC-7, Edward K. Ream wrote: > Imo, the only way to support a significant code base is to care enough > about it to use it every day. > > 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/-/-biPdZHPT5oJ. 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.
