> On Tuesday, January 3, 2012 11:05:49 PM UTC+7, Terry wrote:
> > - I don't think it's possible to support single and double click
> actions without using a timer, which Edward doesn't want, which I
> understand, as they do scary things to code execution pathways
>
> I have no idea about this, nor why new code would need to do anything
> different - Leo seems to currently be distinguishing between single and
> double-click just fine?
Only if single click just selects the node, in which case you don't
notice the fact that *both* the single and double click actions are
taken. Right now the only other thing I can think of that a single
click might do is start editing of a selected node (there's a flag for
that), and without a timer to see if the click was actually the first
of two, you can't have both single and double click actions. Not worth
the complexity unless there's a more important use case, although I did
have timer code working at one point.
> Allow the user to add to the contextmenu.py list, and also to override or
> delete the default ones (currently "baked in") as desired in myLeoSettings.
> Allow for filtering commands out based on presence/absence of a list of @
> directives (ideally allowing user-defined custom ones?).
>
> If not too difficult (blue-sky flag), allow custom scripts to be included,
> ideally via full-command strings as well.
>
> Ideally also allow these to be applied to URLs, parsing the protocol
> (http/ftp) vs file and file extensions (maybe even mime types)
So it seems like there's two things here,
1 have a @setting, probably a @data node, where the user can list a
bunch of 'full-commands' to be listed on the context menu. That
wouldn't be too hard
2 make sure the functionality of plugins is exported as commands - a
mix of documentation and wrapper functions
3 (because lists are always longer than you expect :-) I'm not sure
how this relates to single/double click actions. On the context
menu you pick the item you want - the system doesn't have to guess
which has priority. I think the act-on-node machinery allows a
plug-in to act *and* pass on to subsequent plug-ins, or act and not
pass on.
As an aside, this and another post recently have shown that some people
view Leo's 'full-commands' as a way of extending / scripting Leo. I
think the other post used them to construct an outline, something I'd
never have thought of. While the commands are fine for things like
key-bindings, Alt-X do-something, and maybe a list of commands on the
context menu, as in (1) above, they're always going to be limited.
They don't have conditional constructs and can't do things like
inserting a list of choices based on context as opposed to just
offering themselves. If you really want to shape Leo to your needs,
Python is the way to go.
Not that there's anything wrong with extending Leo with lists of
commands, it's a tribute to Leo's flexibility that you can do that.
Cheers -Terry
2 make sure the functionality of plugins is exported as commands - a
mix of documentation and wrapper functions3 (because lists are always longer than you expect :-) I'm not sure
how this relates to single/double click actions. On the context
menu you pick the item you want - the system doesn't have to guess
which has priority.
Hmm, for a given node type, you want all the actions that make sense
for that node type in a user ordered list, and then some action (double
click?) causes the one highest on the list to occur?
I don't think we'll get there any time soon, most commands / plug-ins
which provide commands rely on the user to say "this command is
relevant to this node", by explicitly running the command on the node.
So there's no general method for having plugins identify whether the
commands they provide are relevant. act-on-node sort of addresses
this, but it's not widely used, and many plugins provide multiple
actions, so the user would still have to pick.
- it would be easy enough to provide a setting which adds command
bindings as context menu entries, if that helps
- having Leo "do something sensible" with *url* nodes is a different
issue, basically Leo will / should just tell the OS to "do something
sensible" with the URL.
Cheers -Terry
Hmm, for a given node type, you want all the actions that make sense
for that node type in a user ordered list, and then some action (double
click?) causes the one highest on the list to occur?
I don't think we'll get there any time soon,
most commands / plug-ins which provide commands rely on the user to say "this command is relevant to this node", by explicitly running the command on the node.
So there's no general method for having plugins identify whether the commands they provide are relevant.
act-on-node sort of addresses this, but it's not widely used, and many plugins provide multiple actions, so the user would still have to pick.
- it would be easy enough to provide a setting which adds command bindings as context menu entries, if that helps
- having Leo "do something sensible" with *url* nodes is a different issue, basically Leo will / should just tell the OS to "do something sensible" with the URL.