tabbing probs

Skip Montanaro skip at pobox.com
Tue Mar 30 22:43:40 EST 2004


    Michael> An editor is crappy if it inserts anything other than what you
    Michael> type into the code.  If I press tab and four spaces are
    Michael> inserted that is crap.

Not if that's what I asked it to do.  I have python-mode in Emacs set to use
4-space indents and only insert SPACE characters, not TAB characters.
Pressing the TAB key while the cursor is at the beginning of line inserts or
deletes enough SPACEs to put the cursor at the correct indentation for the
current line (based upon the indentation and content of the previous line).

    Michael> If I press 'A' and 'a' is inserted that is crap. 

not if I placed my editor in e.e. cummings mode...

    Michael> To me, it sounds as if this entire issue is caused by crappy
    Michael> editors that think they know better than the programmers. 

It has nothing to do with the editors considered in isolation.  By in large
they are doing exactly what the programmers ask them to do.  The problem is
with the interchange of program files between unlike systems (via whatever
means: email, CVS checkins, grabbing from a web page, etc) which have tools
(editors in particular) which interpret TAB characters differently based
upon how the programmers have configured them.  To the best of my knowledge
no systems interpret SPACE characters in weird ways, so using them to
indicate indentation is the only foolproof solution.

Skip




More information about the Python-list mailing list