wasm-demo/demo/ermis-f/python_m/cur/1918

61 lines
2.2 KiB
Plaintext

From: quinn at necro.ugcs.caltech.edu (Quinn Dunkan)
Date: 3 May 1999 18:49:27 GMT
Subject: Indentation on WinNT
References: <372D7DDB.CF5C5588@t-online.de> <1286381846-92313087@hypernet.com>
Message-ID: <slrn7irrtp.gkk.quinn@necro.ugcs.caltech.edu>
Content-Length: 1911
X-UID: 1918
On Mon, 3 May 1999 14:07:12 GMT, Gordon McMillan <gmcm at hypernet.com> wrote:
>Monika G?hmann writes:
>>
>> the concept of using indentation-only structuring in Python code is
>> very nice -- as long as everybody uses Unix and/or reasonable
>> settings with their editor.
>>
>> I have to work with WinNT and when I display code which was
>> developed on Unix it sometimes is all messed up looking like this:
>>
>> if something:
>> if something_else:
>> do this
>> do that
>>
>> So what does this code do ?
>>
>> Is there any way to get this displayed correctly with Vim5.3 or any
>> other editor ?
>
>This is certainly not a general problem of WIndows vs *nix, both of
>which defer all misconceptions about tabs to the viewer / editor.
>(Many email clients are totally brain dead about tabs, and show
>a leading tab as one space.)
>
>My guess is that you're looking at something written as tab=8,
>indent=4 with an editor set for tab=4. If you're using vim, just
>reset your tabstops and see if it looks right.
>
>You could also try:
> http://www.mcmillan-inc.com/dnld/tabcleaner.py
In my .vimrc I have:
se et ts=8 sw=4 softtabstop=4 smarttab
This means that reading files with 8 char tabs will work fine, and all tabs I
enter are 4 chars, all spaces (which is recommended python style). Without
softtabstop, smarttab will alternately insert tabs and spaces which looks wacky
on an editor with ts != 8. Also, in vim, the :retab command can be useful for
this sort of thing. Also, :se list will show you which whitespace is tabs and
which is just space.
And, of course, this thread wouldn't be complete without the admonition to
avoid spreading the evil whitespace-virus. If you think you have it, stay in
your room, burn your clothes, set the thermostat way up, and program
exclusively in tcl. Hopefully this will create a hostile enough environment to
kill it or drive it off.