nodeActions plugin added

7 views
Skip to first unread message

TL

unread,
Feb 27, 2009, 11:10:50 AM2/27/09
to leo-editor
Revision 1608 contains a new nodeActions plugin, modeled after the old
FileActions plugin, designed to invoke a script when a node is double
clicked based on a pattern match to the node's headline.

See the documentation in the Plugins section of the Leo Users Guide
(only available by selecting "Open Users Guide" from the Help menu in
a Leo file until the website is updated).

Please send me any questions or problem reports.

TL

Ville M. Vainio

unread,
Feb 27, 2009, 11:18:37 AM2/27/09
to leo-e...@googlegroups.com
On Fri, Feb 27, 2009 at 6:10 PM, TL <t...@tltools.net> wrote:

> Revision 1608 contains a new nodeActions plugin, modeled after the old
> FileActions plugin, designed to invoke a script when a node is double
> clicked based on a pattern match to the node's headline.

Have you check act-on-node? Seems like this is a special case of the
very same thing (which mostly proves that it's a good idea ;-).

--
Ville M. Vainio
http://tinyurl.com/vainio

TL

unread,
Feb 27, 2009, 11:21:35 AM2/27/09
to leo-editor
Use revision 1609. I forgot to "bzr add" the new nodeActions.py file
before updating the trunk.

TL

unread,
Feb 27, 2009, 11:49:46 AM2/27/09
to leo-editor
It's my understanding that act-on-node addresses issues with how
plugins trigger on events such as the double click of the node's
icon. The nodeActions plugin is intended for Leo users to create and
assign scripts to nodes on a Leo file by file basis.

Concerning the overlap between these two plugins, I think you may be
the best one to evaluate that. Review the documentation on the
nodeActions plugin and let me know what you think.

Regards,
TL

Ville M. Vainio

unread,
Feb 27, 2009, 12:13:28 PM2/27/09
to leo-e...@googlegroups.com
On Fri, Feb 27, 2009 at 6:49 PM, TL <t...@tltools.net> wrote:

> Concerning the overlap between these two plugins, I think you may be
> the best one to evaluate that. Review the documentation on the
> nodeActions plugin and let me know what you think.

I think nodeActions should be implemented as act-on-node hander. That
is, loading the nodeActions plugin should register one function to
check whether the active node matches one of the sought-after patterns
and dispatch the wanted node.

I can do the work on nodeActions for this. It will serve as a nice example :-)

The whole point of act-on-node is making plugins co-operate on
"default action", so nodeActions can still play nice even if another
active plugin is interested in icon doubleclick activity.

Terry Brown

unread,
Feb 27, 2009, 12:54:54 PM2/27/09
to leo-e...@googlegroups.com
On Fri, 27 Feb 2009 19:13:28 +0200
"Ville M. Vainio" <viva...@gmail.com> wrote:

> > Concerning the overlap between these two plugins, I think you may be
> > the best one to evaluate that. Review the documentation on the
> > nodeActions plugin and let me know what you think.
>
> I think nodeActions should be implemented as act-on-node hander. That
> is, loading the nodeActions plugin should register one function to
> check whether the active node matches one of the sought-after patterns
> and dispatch the wanted node.
>
> I can do the work on nodeActions for this. It will serve as a nice
> example :-)
>
> The whole point of act-on-node is making plugins co-operate on
> "default action", so nodeActions can still play nice even if another
> active plugin is interested in icon doubleclick activity.

TL has been talking to me off list about mods to active_path, and if I
understand correctly he'd would like to see active_path support a
@setting to stop it gobbling double-clicks on *file* nodes, so that
open_with still works.

This is exactly the kind of conflict (between plugins :-) we've been
discussing, and I still don't see how act-on-node would help. How is
active_path supposed to know the user wants active_path to step aside
in favor of open_with?

If active_path and open_with both published commands to do what they
do, TL could bind them to whatever he wanted, open_with on double-click
and active_path on alt-click or ctrl-space, or whatever.

This also sidesteps the problem that TL wants increased granularity in
active_path's view of nodes it understands. I.e. a "do what you do to
this node, *unless* it's a file node" action, as well as it's existing
"do what you do to this node" action.

You can of course get 5 and even 7 button mice...

Cheers -Terry

Ville M. Vainio

unread,
Feb 27, 2009, 1:54:31 PM2/27/09
to leo-e...@googlegroups.com
On Fri, Feb 27, 2009 at 7:54 PM, Terry Brown <terry_...@yahoo.com> wrote:

> This is exactly the kind of conflict (between plugins :-) we've been
> discussing, and I still don't see how act-on-node would help.  How is
> active_path supposed to know the user wants active_path to step aside
> in favor of open_with?

Well, it never should IMO. A context-sensitive action (active_path)
should always take precedence over a plugin applicable to all nodes
(open_with).

> If active_path and open_with both published commands to do what they
> do, TL could bind them to whatever he wanted, open_with on double-click
> and active_path on alt-click or ctrl-space, or whatever.

Nothing is preveting from still doing it. act-on-node won't prevent
anything (unless that's the sole interface a plugin provides).

> This also sidesteps the problem that TL wants increased granularity in
> active_path's view of nodes it understands.  I.e. a "do what you do to
> this node, *unless* it's a file node" action, as well as it's existing
> "do what you do to this node" action.

Providing this kind of granularity is what act-on-node easily
provides. I do think act-on-node is a very bad fit for open-with
plugin, event though I still disagree about active_path ;-)

Terry Brown

unread,
Feb 27, 2009, 2:27:33 PM2/27/09
to leo-e...@googlegroups.com
On Fri, 27 Feb 2009 20:54:31 +0200

"Ville M. Vainio" <viva...@gmail.com> wrote:

> A context-sensitive action (active_path)
> should always take precedence over a plugin applicable to all nodes
> (open_with).

But very often active_path's context will be essentially the whole
file. You're working in directory X, you have @path X at the root of
the tree, active_path thinks it has something to offer for every node
in the tree. And TL wants to use open_with specifically withing an
active_path context.

> > If active_path and open_with both published commands to do what they
> > do, TL could bind them to whatever he wanted, open_with on
> > double-click and active_path on alt-click or ctrl-space, or
> > whatever.
>
> Nothing is preveting from still doing it. act-on-node won't prevent
> anything (unless that's the sole interface a plugin provides).

True, of course.

> > This also sidesteps the problem that TL wants increased granularity
> > in active_path's view of nodes it understands.  I.e. a "do what you
> > do to this node, *unless* it's a file node" action, as well as it's
> > existing "do what you do to this node" action.
>
> Providing this kind of granularity is what act-on-node easily
> provides. I do think act-on-node is a very bad fit for open-with
> plugin, event though I still disagree about active_path ;-)

I don't see how act-on-node helps with the granularity. Normal use of
active_path is to act on both directory and file nodes. TL wants to
target directories only. If active_path published a command to do what
it does that could be easily bound at will to whatever the user found
convenient, the granularity comes for free based on which binding the
user activates. I can't see how act-on-node would deal with this, or
with the open_with / active_path conflict in general.

Cheers -Terry

TL

unread,
Mar 4, 2009, 10:40:49 AM3/4/09
to leo-editor
Rev 0.2 has been uploaded to the Trunk. Support for pattern
Directives has been added to provide:

- support for Regular Expressions
- support for triggering on multiple patterns
- support for passing the double-click event to other plugins
when a pattern match has occurred.

See the Chapter 12 of the Leo Users Guide for the latest
documentation.

Regards,
TL

Kent Tenney

unread,
Mar 4, 2009, 11:03:10 AM3/4/09
to leo-e...@googlegroups.com
I haven't had time lately to explore Leo stuff, this looks really good!

Speaking of Leo's feature explosion, is there a 'changes' list which
chronologically itemizes new and changed _features_ ?

I think the situation where I have a couple of hours to play
with Leo customization, after a couple weeks of being swamped
with other stuff.

I know there have been lots of commits, discussions of new
features and capabilities. I haven't been able to keep track of these.

I'd like to scan a list of descriptions of changes in Leo's capabilities
over the last couple weeks, quickly review prior ones. Ideally the
description would tell where to find more complete doc.

Case in point, 2 weeks from now I will forget that the name
of this cool feature is 'nodeActions', I will search my mail
guessing at keywords etc, find this email maybe quickly,
maybe slowly, maybe give up.

It seems this list should be somehow created via filtering
commit messages, don't know if that's possible. It probably
won't work if it requires an additional task.

Thanks,
Kent
Reply all
Reply to author
Forward
0 new messages