special editor support for indentation needed.

Eric S. Johansson esj at harvee.org
Fri Nov 14 17:27:49 EST 2008


drobinow at gmail.com wrote:
> 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?

yes and it doesn't work right.  Type this in:

class pet (object):
    """
    """
    def cat(self):
        """
        """
        if food in bowl:
            self.empty = True

    def dog(self):
        """
        """
        if food in bowl:
            self.empty = True
	else:
	    self.bark_nonstop()

 at the end of the method cat, a newline puts you at the left-hand margin and a
subsequent tab  lines you up with self.empty.  Pressing backspace at that point,
terminates the if.  It's reasonable behavior and should be useful when assigned
to the "close block" utterance.  But remember, my goal is to have a variety of
options for selecting the correct level of indentation with my eyes closed.
Speaking a lot to get a little effect is dangerous to the health of one's vocal
cords and, a text-to-speech output doesn't let you know what lines up with what.

 for what it's worth, in thinking about this problem, try to figure out what you
would say to someone who is slightly deaf and a poor typist to get them to
generate the code you want.  Then figure out what you want to say in the same
situation if you had a bad sore throat.


---eric



More information about the Python-list mailing list