On Sun, Feb 22, 2009 at 2:38 PM, Ville M. Vainio <[email protected]> wrote:
> The implementation is completely obvious and has absolutely no effect
> on existing code, I'll probably push it this evening (have to leave
> now).
I have pushed it now. Introdoces command act-on-node (keyboard
shortcut still unbound).
Run this script to test it:
QQQ
import leo.core.leoPlugins
def act_print_upcase(c,p,event):
if not p.h.startswith('@up'):
raise leo.core.leoPlugins.TryNext
p.h = p.h.upper()
g.act_on_node.add(act_print_upcase)
QQQ
Then run alt-x act_on_node on a node that starts with @up (yeah, you
guessed it ;-).
I didn't add friendlier error handling yet (for the case where there
is no action defined for a node). It would probably be somethin akin
to g.es("no act-on-node action defined, plugin not loaded?").
TBD is porting active_path to use it instead of requiring a @button,
just verify that the implementation is in right place before I
proceed. Also, where should I add the keyboard shortcut binding?
--
Ville M. Vainio
http://tinyurl.com/vainio
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
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
-~----------~----~----~----~------~----~------~--~---