In another thread I said, "it doesn't seem likely that emacs will ever be 
scriptable with python.  Unless some hero steps up Leo in emacs will remain 
a tantalizing possibility, just out of reach."

Happily I was forgetting pymacs and Leo's bridge 
<http://leoeditor.com/emacs.html#controlling-leo-from-emacs-using-pymacs>.  
In effect, Leo's support for pymacs *already* makes emacs scriptable using 
python!  To repeat the example:

; Step 1: load leoPymacs if it has not already been loaded.(setq reload nil)(if 
(or reload (not (boundp 'leoPymacs)))
    (setq leoPymacs (pymacs-load "leoPymacs" "leo-"))
    (message "leoPymacs already loaded"))
; Step 2: compute the path to leo/test/ut.leo using a Leo script.(setq script
    "g.app.scriptResult = g.os_path_abspath(
        g.os_path_join(g.app.loadDir,'..','test','ut.leo'))")(setq fileName 
(leo-run-script nil script))
; Step 3: execute a script in ut.leo.(setq c (leo-open fileName))(setq script 
"print 'c',c.shortFileName() ,'current:',c.p.h")(leo-run-script c script)


Folks, this is a big deal.  An emacs champion could easily:

1. Add any desired (python) functions to leoPymacs.py.
2. Add any desired (elisp) hooks to emacs, especially org mode.

The way appears open to embed Leonine support into emacs.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8e3efa10-6b55-47d9-a96f-3b7f93c31041%40googlegroups.com.

Reply via email to