New Command "execute-external-file" Now In Devel

28 views
Skip to first unread message

Thomas Passin

unread,
Feb 22, 2023, 11:21:44 PM2/22/23
to leo-editor
The new command to run external files, "execute-external-file", is now in the devel branch.  Thanks to all who helped me test and improve it!

This new minibuffer command will find the nearest external file root node, try to figure out what kind of processor to run it - python, ruby, julia, etc. - based on the @langauge directive in effect, and launch it in a new terminal that will remain open even after the program finishes.  The purpose of having a new terminal is 1) so the output can be read without getting mixed up with any Leo output, and 2) so that output can be seen and not interfere with other Leo output even for long-running GUI programs that a user may want to launch.

It was challenging to get the script to launch a new terminal that would also stay open in Linux.  It's possible that one or another Linux distro might have a terminal program that the script cannot figure out.  If so, the terminal to use can be specified in an @setting node.  The script has been tested in at least six different Linux distros and works in all of them, so almost no one should have a problem.  Tested distros: Mint/Cinnamon, Debian, Ubuntu, Manjaro (xfce), OpenSUSE, and Fedora.

If you want to launch programs with a processor that the command does not know about (currently python, lua, ruby, julia, cmd.exe and shell), you can use the same @setting node to specify it.  Read the docstring for more details.

Sad to say, the command does not work for MacOS yet.  I don't have a Mac computer, and I don't know key things like the name of the Mac terminal and shell.  If someone can help me with this, we should be able to get it going for the Mac as well.

I have used a predecessor of this script for years and would find it inconvenient to get along without.  I hope it will be useful to you too!

Edward K. Ream

unread,
Feb 23, 2023, 4:00:20 AM2/23/23
to leo-e...@googlegroups.com
On Wed, Feb 22, 2023 at 10:21 PM Thomas Passin <tbp1...@gmail.com> wrote:
The new command to run external files, "execute-external-file", is now in the devel branch.  Thanks to all who helped me test and improve it!

Many thanks for this ambitious work.

I like your chatty description of the command here. Might I suggest folding these comments into the docstring?

Edward
Reply all
Reply to author
Forward
0 new messages