Thread (95 messages) flat view 95 messages, 33 authors, 2016-06-15

Re: On Tabs and Spaces

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:43:42


On Tue, 16 Oct 2007, Mike Hommey wrote:
Actually, part of the mess with tabs is due to the fact they're not
exactly 8 spaces wide, but any width that ends at a multiple of 8
characters from the start of the line. So 0 <= n < 8 spaces and a tab
is still 8 spaces.
Umm.. That's the definition of "tab width".

The tab width is 8. Not "0 < n <= 8". Not "depends on where you are". The 
tab width is 8.

The whole history of tab is that it comes from mechanical "tab stops" that 
you could set, and that were independent of the text - pressing the tab 
key would move to the next tab stop.

Now, those tab stops were movable, and in fact, I think lots of terminals 
still support setting those tab stops dynamically (ie you can send control 
sequences to set their "tab stops" to different points, exactly like an 
old mechanical typewriter).

But when it comes to computers, 8-character wide tab stops is the 
de-facto standard. It's what every single terminal defaults to. It's the 
only thing that some printers/terminals support. Anything else is by 
definition non-standard.

			Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help