Just playing with part of a template system, the (partial) mock up for
"range()" is:

def tabStopNaming (event=None):

   stateName = 'naming'
   k = c.k
   state = k.getState(stateName)

   help = ('start-value -- optional, -> fill-in or tab eliminate.  ',
            'end-value -- required, -> fill-in.  ',
            'step -- optional, ->fill-in or tab to eliminate.  ')
   tabStop = ('start-value', 'end-value', 'step')

   if state == 0:
       k.setLabelBlue(help[0],protect=True)
       k.getArg(event,stateName,1,tabStopNaming)
       # g.es('does this ever executed?') # yes, imediately!
   else:
       k.clearState()
       g.es_print('%s : %s' % (tabStop[0], k.arg))
       k.setLabelBlue('')

tabStopNaming()

=====================================================
This is hardwired for the first parameter.  Things I need to expand
this:

1. put in a variable that cycles through the tabStops

2. In this mock up, you are entering the parameters in the minibuffer,
a more advanced version would collect each keypress and put it in the
body at the current tabStop, a tab would finalize the entry and
advance to the next stop, no text other than the 'help', ends up in
the minibuffer.

Sinc I'm only modifying existing code without real understanding of
what Leo is doing, andy guidance would be appreciated.

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to