Thanks for your answers. I have found this functionality already developed in "emacs" (dont even know what is that, but I have read somewhere that its similar to Leo) http://ergoemacs.org/emacs/emacs_templates.html Check the screenshot, it perfectly illustrates the feature. I have added it to my "to do list" for when I know how to use Leo, It would be great to adapt that one (if its not already done) so new users can directly use already existing templates for programming languages.
On Wednesday, November 21, 2012 3:55:43 PM UTC+1, João Alexandre Toledo wrote: > > Hi. > > As I use Leo to write PL/SQL code, I need to write similar text several > times, changing only small parts of it. It would be great if I could create > a node with the "template" and then clone it everywhere it should be > written, and then providing the parameters to be used in this writing. > > Let me try to clarify it. I'd like to create a tree like this: > > +- @file something.sql > +- Section 1 > + << Clone >> with Parameters A, B > +- Section 2 > + << Clone >> with Parameters C, D > > In this tree, both "Clone" nodes would be generated from a template > specified somewhere in the tree, and would have parts of its text replaced > with values "A" and "B" in Section 1, and "C" and "D" in Section 2. > > I've searched but couldn't find anything like this, then I've thought of > trying to write a hook to intercept the "save" command, but couldn't think > of a way to pass the parameters; I think the obvious way would be to put > the parameters after the "<< >>", but then all cloned nodes are changed, so > it wouldn't work. > > Another alternative would be creating some kind of directive @something, > but I have no idea of how to do that. > > > Any ideas? > > By the way, Leo is great! > Thanks. > > João > -- 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?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
