special editor support for indentation needed.

Discussion in 'Python' started by Eric S. Johansson, Nov 14, 2008.

  1. in trying to make programming in Python more accessible to disabled programmers
    (specifically mobility impaired speech recognition users), and hitting a bit of
    a wall. The wall (for today) is indentation. I need a method of getting the
    "right indentation" without having to speak a bunch of unnecessary commands.
    For example, depth specified by the previous line. But, frequently you need to
    go to a more arbitrary indentation for example the right level of indentation
    for a method definition or class definition. This indentation should be
    something you could get by typing/speaking the right command with your eyes closed.

    For example if I was to give the command "new method", I should be able to spit
    out a template (contained within the speech recognition environment) and through
    a command embedded in the template, force indentation to the right level for
    "def" and then the editor would control indentation for the rest of the text
    injection.

    I prefer are working in Emacs because that's where I have a lot of my speech
    grammars set up but I'm not averse to trying another editor. The only condition
    is that the editor must run a Windows and have remote editing mode (like tramp)
    so I can edit on remote machines.

    ideas?
    Eric S. Johansson, Nov 14, 2008
    #1
    1. Advertising

  2. Eric S. Johansson

    Matimus Guest

    On Nov 14, 11:41 am, "Eric S. Johansson" <> wrote:
    > in trying to make programming in Python more accessible to disabled programmers
    > (specifically mobility impaired speech recognition users), and hitting a bit of
    > a wall.  The wall (for today) is indentation.  I need a method of getting the
    > "right indentation" without having to speak a bunch of unnecessary commands.
    > For example, depth specified by the previous line.  But, frequently you need to
    > go to a more arbitrary indentation for example the right level of indentation
    > for a method definition or class definition.  This indentation should be
    > something you could get by typing/speaking the right command with your eyes closed.
    >
    > For example if I was to give the command "new method", I should be able to spit
    > out a template (contained within the speech recognition environment) and through
    > a command embedded in the template, force indentation to the right level for
    > "def" and then the editor would control indentation for the rest of the text
    > injection.
    >
    > I prefer are working in Emacs because that's where I have a lot of my speech
    > grammars set up but I'm not averse to trying another editor.  The only condition
    > is that the editor must run a Windows and have remote editing mode (like tramp)
    > so I can edit on remote machines.
    >
    > ideas?


    You could make use of something like 'pindent.py' (comes with python
    in windows under the \Python2x\Tools\Scripts folder). Which allows you
    to put in block delimiters as comments, and then fixes the code to
    align itself correctly to those blocks:

    def foobar(a, b):
    if a == b:
    a = a+1
    elif a < b:
    b = b-1
    if b > a: a = a-1
    # end if
    else:
    print 'oops!'
    # end if
    # end def foobar

    Funny though. I always saw this tool as a sort of joke response to
    people who missed their block delimiters. "You want block delimiters?
    Use this." And see how long before they decide it is silly.

    Matt
    Matimus, Nov 14, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    633
    Stylus Studio
    Aug 3, 2004
  2. Replies:
    1
    Views:
    415
    Peter Flynn
    Jul 6, 2005
  3. Fransis il Mulo

    Help for a special editor

    Fransis il Mulo, Nov 29, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    263
    Alexey Smirnov
    Nov 30, 2007
  4. Eric S. Johansson
    Replies:
    24
    Views:
    525
    Barry Warsaw
    Nov 27, 2008
  5. Jesse B.
    Replies:
    2
    Views:
    176
    Josh Cheek
    Mar 27, 2010
Loading...

Share This Page