On Mon, 8 Feb 2016 06:07:33 -0800 (PST)
john lunzer <[email protected]> wrote:
> I'm a little confused by your request and perhaps Jacob answered it
> but I feel like I heard a much simpler question.
>
> You can use the @others directive in the body of you @command node.
> This is the same as what you would do in an @<file> node.
I think there are two different ideas here:
@command("command_a")
command_a preamble
@others
first part of command_a
second part of command_a
first subpart of second part of command_a
second subpart of second part of command_a
so a single command, with structure organized in a tree, vs.
common_setup
some common code
@command("command_b")
eval(g.findTestScript(c,'common_setup'))
command_b stuff
@command("command_c")
eval(g.findTestScript(c,'common_setup'))
command_c stuff
i.e. two commands sharing code.
that said, can't imagine how a single command could have 70 child
nodes, so maybe I'm not understanding what you were up to John.
Cheers -Terry [email protected]
> I have abused this horribly to my own ends to write a complex
> refactoring plugin as an @command that has over 70 child nodes. I did
> this before I fully understood plugins.
>
> On Friday, February 5, 2016 at 4:20:23 PM UTC-5, jkn wrote:
> >
> > I'm getting around to writing some useful @command scripts today,
> > and I wondered about what is probably a faq:
> >
> > does the whole body of an @command script have to live within a
> > single node? I have several commands which have common
> > functionality, and I want to be able to do the equivalent of
> > 'import <node>'.
> >
> > The Scripting tutorial page tantalises with: "*you can create
> > complex scripts from a node and its descendants*", but I think this
> > is referring to scripts written to external files.
> >
> > Apologies if there is (as I suspect) a simple explanation of this
> > somewhere.
> >
> > Thanks
> > Jon N
> >
>
--
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.