special editor support for indentation needed.

drobinow at gmail.com drobinow at gmail.com
Fri Nov 14 17:13:03 EST 2008


On Nov 14, 4:08 pm, "Eric S. Johansson" <e... at harvee.org> wrote:
> Almar Klein wrote:
> > Hi Eric,
>
> > First of all, I like your initiative.
>
> there's nothing like self interest to drive one's initiative.  :-) 14 years with
> speech recognition and counting.  I'm so looking to my 15th anniversary of being
> injured next year....
>
> another initiative is exporting the speech recognition environment to the Linux
> context.  In a nutshell, he dictated to application on Windows, it tunnels over
> the network to a Linux machine, and will allow you to cut and paste to and from
> that Linux application.  I could definitely use some high quality volunteer
> talent for this effort.   it would make a huge quality of life difference to
> disabled developers.    This work would also be usable by the folks in the wine
> project who are supporting  NaturallySpeaking.
>
> > I'm not sure if I undestand you correctly, but can't you just
> > increase indentation after each line that ends with a colon?
> > That's how I do it in my editor. The user would then only need
> > to specify when to decrease indentation.
>
> here's an example of the problem:
> class foo( object):
>     def cat(self)
>         self.x=1
>         def dog
>             self.x=2
>
> this is legal Python but it's not what you need 99% of the time.  There is no
> cue to the editor to tell it to outdent to give me what I really want which is:
>
> class foo( object):
>     def cat(self)
>         self.x=1
>     def dog
>         self.x=2
>
> so there should be a mechanism for saying "indent the level of the previous
> definition".  For what it's worth, this would translate in speech recognition of
> arm in vocola pseudocode to
>
> new  method = <def indent>def ^(self):{enter}"""{enter}"""{enter}<srch backwards
> and delete ^>
>
> which would allow me to create a method definition and put me back at a place
> where I can speak the method name.  There's other stuff in these be done like
> allowing you to modify various features by names such as adding/deleting
> arguments, modifying array indices etc.  If you are not careful, I'll talk about
> command disambiguation through scope reduction and the related visual elements
> in the working environment.
>
> I really need a job doing this UI stuff.  :-)

The backspace key in emacs does exactly what you want. Have you tried
it?

For python.el, distributed with Gnu Emacs:
 DEL (translated from <backspace>) runs the command python-backspace,
which is an interactive compiled List function in `python.el`

For python-mode.e, distributed with XEmacs (but usable with Gnu
Emacs):
 DEL (translated from <backspace>) runs the command py-electric-
backspace, which
is an interactive compiled Lisp function in `python-mode.el'.





More information about the Python-list mailing list