On Wed, Jun 14, 2017 at 7:41 AM, Eric S. Johansson <ynotlayab...@gmail.com> wrote:
> I'm trying to convert the button command I showed earlier into a command I > can invoke by speech recognition (command via minibuffer). Looking through > the documentation, I'm thinking may be an @command node might be one way to > go. > Both @command and @button create the command names based on the headline of the @button or @command node. You can use tab completion in the minibuffer to see all such commands: <Alt-x>@command<tab> or <Alt-x>@button<tab> I was thinking about running it as a plug-in but I'm missing an example > that lets me create mini buffer commands. > The g.command decorator creates commands from top-level nodes. There are many examples in leoPlugins.leo. Be sure to follow the pattern exactly. Also, I'm not sure where to put my commands/plug-ins outside of the Leo > hierarchy. Is there a way of specifying a different location for user > created plug-ins/commands? > We discussed this recently. You can put them anywhere on python's sys.path, *provided* you enable them in the @enabled-plugins node by module name, not file name: myplugin rather than myplugin.py I think a plug-in is the right way to go because it would give me the > capability of operating either on a node or a hierarchy of nodes. > Yes. Plugins are more flexible. > One thing I need is a way of handling the user interface for matching > string names to code > > names. > > Ideally, there should be some place for a dialogue where the string name > is displayed and the focus is on the codename field. The simplest would be > something like the Emacs mini buffer interaction for user input. > Plugins/scripts can get data from the minibuffer. Recent changes make it a simpler. For examples, search for get1Arg in leoPy.leo. 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 leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.