space/tab conversion utility?

Grant Edwards grante at
Thu Jul 29 04:10:02 CEST 2004

On 2004-07-29, Tim Peters <tim.peters at> wrote:
> [Grant Edwards, wants to convert spaces to tabs]
>> ...
>> 2) Simply converting all leading spaces to the right number of
>>   tabs (unexpand knows how to do that) isn't correct.  Only
>>   the spaces that are block-indent spaces should be converted.
> ...
> is in your Python distribution, and is the state
> of the art for "intelligent" conversion of tab-infected files
> to space-celebrating ones.  I understand that's not the
> direction you want, but it is the *code* you want to start
> from. [...]

That does indeed sound like the right starting point.  The
other option I can think of would be to hack up Jed's
Python-mode so that it attempts to automatically detect whether
tabs or spaces should be used.  

Or I could go work on my car.

Grant Edwards                   grante             Yow!  BEEP-BEEP!! I'm a
                                  at               '49 STUDEBAKER!!

More information about the Python-list mailing list