Huge Aha: org mode/vimoutline champions don't have to transliterate Leo's python code!

53 views
Skip to first unread message

Edward K. Ream

unread,
Aug 3, 2019, 11:02:53 AM8/3/19
to leo-editor
The way is now clear for close integration with Leo and either emacs org mode or vimoutline.  Similar remarks apply to both, so I'll just discuss org mode here.

I have been assuming that supporting Leo in emacs would require transliterating much of Leo's core into elisp.  But that's not so!  An org mode champion only need tweak org mode so it communicates with Leo. Using Leo's bridge, elisp code would request various Leonine services.  Examples of such services are:

- Update the Leo outline when the org mode outline changes.
- Update external files using Leo's existing python code.
- Request a unique gnx for a new node.

The elisp code could request these Leonine services when saving the org mode file, whenever an org mode node changes, or at other times.

Python wrappers provide Leonine services

An org mode champion need only define simple (python) wrappers (in Leo) that provide these services. There should be no need to transliterate Leo's python code into elisp!

Summary

The proposed interaction between org mode (or vimoutline) and Leonine services is a momentous breakthrough in Leo's history.

Perhaps only a page or two of elisp (or vimscript) code would be needed, and a page or two of python code.

Edward

Edward K. Ream

unread,
Aug 3, 2019, 11:13:44 AM8/3/19
to leo-editor
On Saturday, August 3, 2019 at 10:02:53 AM UTC-5, Edward K. Ream wrote:

Summary

The proposed interaction between org mode (or vimoutline) and Leonine services is a momentous breakthrough in Leo's history.

Perhaps only a page or two of elisp (or vimscript) code would be needed, and a page or two of python code.

I forgot to mention something very important.  There will be no need for a champion to design anything new. Org mode will work exactly as before, but it will support Leonine operations on the org mode nodes.

Do you see how important this is? Org mode headlines might contain @file x.y or @clean x.y without org mode knowing or caring.  Similarly, org mode itself will know nothing about Leo directives and section references in org mode bodies.

Syntax coloring would likely be another Leonine service.  That service might return a description of the colorizing for a particular org mode node.

Edward

Offray Vladimir Luna Cárdenas

unread,
Aug 3, 2019, 3:02:14 PM8/3/19
to leo-e...@googlegroups.com

Congrats on this aha :-)

Really glad to see the Leo services coming finally to the picture. It was a long path, but surely a pretty powerful one.

Cheers,

Offray

--
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 leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/5fb66438-9cb7-441d-92cd-455eca4cc8c9%40googlegroups.com.

Edward K. Ream

unread,
Aug 3, 2019, 4:04:35 PM8/3/19
to leo-editor
On Sat, Aug 3, 2019 at 2:02 PM Offray Vladimir Luna Cárdenas <off...@riseup.net> wrote:

Congrats on this aha :-)

Thank you.

Edward

Edward K. Ream

unread,
Aug 3, 2019, 4:13:16 PM8/3/19
to leo-editor
On Saturday, August 3, 2019 at 10:02:53 AM UTC-5, Edward K. Ream wrote:

Summary

The proposed interaction between org mode (or vimoutline) and Leonine services is a momentous breakthrough in Leo's history.

Perhaps only a page or two of elisp (or vimscript) code would be needed, and a page or two of python code.

And I am the pyzo champion!  A page or two of python code (patched into pyzo) should suffice to embed Leo into pyzo.  My experiences will guide champions for vimoutline and org mode.

Pyzo doesn't presently allow plugins or other code-level optimizations, but that doesn't matter.  I can patch any part of pyzo using the techniques in pyzo_support.py.

I'll be working on this project next.

Edward

Edward K. Ream

unread,
Aug 4, 2019, 7:14:32 AM8/4/19
to leo-editor


On Saturday, August 3, 2019 at 3:13:16 PM UTC-5, Edward K. Ream wrote:

And I am the pyzo champion!  A page or two of python code (patched into pyzo) should suffice to embed Leo into pyzo. 

That's too optimistic.  Unlike org mode or vimoutline, pyzo doesn't already have an outline mode.   I'll probably represent .leo in pyzo as a kind of folded text file, as pyzo already supports, but considerable new work is likely.  Otoh, this work may be "pre-writing" for #1228: integrated outline/body pane.

Any estimate for this project would be premature.  Having said that, the project looks much easier from the new perspective of using Leo's bridge to do most of the heavy lifting.

Yesterday I came up to speed with previous work.  All of it will disappear, to be replaced, I think, with a LeoInterface class embedded somewhere in pyzo, and used in all patched pyzo files.  Doing that cleanly is next.

Edward
Reply all
Reply to author
Forward
0 new messages