Re: Tabs, spaces, and indentation

Bennett Todd (bet@std.sbi.com)
15 Apr 1994 17:27:33 GMT

Guido van Rossum <guido@cwi.nl> wrote:
>People who want to see 4-space indentation on Unix may have no choice
>but to mix spaces and tabs -- most editors' auto-indent mode optimizes
>8 spaces into a tab.

Errh, that puzzles me. The only two editors I use frequently enough to have
memorized are vi(1) (which I use long enough to bring up jove) and jove(1).
>From memory, in vi:

:se ts=4 sw=4

should fix things, and in Jove:

M-x set internal-tabstop 4

does the trick. I would presume that GNU Emacs can achieve the same end; god
knows, it has plenty of features:-). So in my experience, I'd tend to assert
the reverse, that most editors can be told how many spaces to indent on tab.

I've gotten in the habit of always using tabs only at the beginning of the
line, to establish indentation; all internal spacing (to make comments line
up, to align ``='' signs, and so on) I do with spaces. When a line is
continued, and the continuation has some eccentric additional indentation, I
only use tabs up to the prevailing indentation level, and use spaces for the
extra bit. This practice leaves all the indentation and layout correct when
the tab size is changed --- folks who are more accustomed to looking at code
with 8-space-wide indentation can do so, and I can edit my code with
4-space-wide indentation.

-Bennett
bet@sbi.com