On Sat, Dec 23, 2023 at 8:23 PM HaveF HaveF <[email protected]> wrote:
> I frequently employ the same specific functions such as fun1, fun2, and
so on.
Here is the easy (and flexible!) way:
- Define a shared @command f1 node in your myLeoSetting.leo for your
function f1.
- Execute the function with: c.doCommandByName("f1").
Yes, a custom plugin can inject functions into the 'g' namespace.
I suggest using a prefix (like havef_) to ensure the new functions can't
conflict with existing global functions. The plugin would be something like
this (*not *tested):
from leo.core import leoGlobals as g
<< define your functions >>
def init() -> bool:
g.havef_f1 = f1
g.havef_f2 = f2
HTH.
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3QS08%2B1J78Gus6VASqFZ%2Bx9N19F%2BwCfY7ZKGjb-B_wpQ%40mail.gmail.com.