Issue #171 <https://github.com/leo-editor/leo-editor/issues/171> ( Improve 
handling of @command and @button nodes) is now complete. It has taken the 
better part of three full days. The changes are subtle and the 
behind-the-scenes changes are hairy. Nevertheless, the effort has been well 
worthwhile. Leo works more smoothly.

I have been continuously testing the code, but it's complex. Problems old 
or new may exist. There is plenty of time before Leo 5.1 final, so *please 
report any problems immediately*.

Here are the highlights of the changes:

1. All @button and @command nodes (*script nodes*) now have the best 
possible balloon comments, regardless of their sources. All @buttons nodes 
show a "Goto Script" menu item when right-clicked.

2. Script nodes defined in myLeoSettings.leo or leoSettings.leo (*common* 
script nodes) now define *static *scripts.  Leo *never *opens other files 
in order to execute common scripts.  This corrects a major design blunder.

Leo *will *open a settings file when the user selects the "Goto Script" 
item in an @button node's popup menu. If the settings file is open in 
another copy of Leo, Leo will, as usual, ask you whether you want to open 
it again.  This should not be a problem.

3. Script nodes add their commands to Leo's command history *only *if they 
contain @args add in their headline::

    @button command-name @key = Alt-5 @args add
    @command command-name @args add    


Users will not want most @button and @command nodes to predefine entries in 
command history.  To see why...

4. <Alt-x>@<tab> now shows the sources of all @button and @command nodes. 
An actual example:

               L @button-clean-text
               L @button-join-path
    Ctrl+Key+6 M @button-run-pylint
               L @button-split-path
    Ctrl+Key+9 L @button-vim-node
               M @command-align-eq-signs
    Alt+Key+9  L @command-beautify-tests
               M @command-c-to-python-clean-docs
               L @command-cfa
               M @command-clean-all-blank-lines
               M @command-clean-body
               M @command-clean-diff
               M @command-clean-spellpyx
               M @command-count-pages
               M @command-create-def-list
               M @command-flatten-script
               M @command-join-node-above
               M @command-join-node-below
               M @command-join-selection-to-node-below
               M @command-print-cmd-docstrings
               M @command-promote-bodies
               M @command-remove-newlines
               M @command-split-defs
    
    legend:
    G leoSettings.leo
    M myLeoSettings.leo
    L local .leo File

Too many entries! As a result, most of  #172 
<https://github.com/leo-editor/leo-editor/issues/172> will not make it into 
Leo 5.1 final. There is no great need for command completion for just a few 
history items. I will, however, fix the problems with the way the command 
history works.

This is an important new feature, even though the print-buttons command 
does pretty much the same thing. Leo prints the legend only if the tab 
completion shows @button or @command nodes.

5. The mod_scripting plugin now handles gracefully nodes such as::

    @button pylint
    c.k.simulateCommand('pylint')

Previously, executing this script would create an unbounded recursion.  
Now, the plugin creates a fully functional button for this node, but the 
plugin silently refuses to redefine the existing pylint command.  End of 
recursion. 

<alt-x>pylint<return> executes the *old *command, not the @button script. 
Everything works smoothly. This is important, though few will likely notice 
the difference.

That's all for now.  All questions and comments welcome.

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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to