[KLUG Members] I want to be the master of tabs

Robert G. Brown members@kalamazoolinux.org
Fri, 11 Jul 2003 20:38:30 -0400


On 11 Jul 2003 20:04:33 -0400, Dirk Bartley <bartleyd2@chartermi.net> wrote:

>man expand
>man unexpand
>
>hmmm
>
>I wish those were known by me before I wrote some perl scripts to do 
>just that.
Well, it's not bad experience... although it seems like you would
have foregone the honor of it all! :)

>Good thought, but I need to do this at the terminal?? level. 
It doesn't seem like that's the right place to look, at least not these days.

Tabs are really intreesting anachronisms, in many ways. They were really 
valuable back in the days of slow serial communication, and when terminals
(15-45 char/sec) ran on dialup lines and were the only common output 
devices, so they had to double as plotters, for example. Setting tabs
and then putting them in the output stream really made stuff like that 
go faster.

Now we have real plotters, graphics, and printers that do a far better job
of rendering then onto paper than the old terminals did. Thus we have not 
heard a lot about tab control....
 
>The debugging program I use is outputting my tabs indented out
>farther than I would like and I would like to continue to use 
>tabs instead of spaces.
Yes, and this is the only really common use of tabs that we see these days.
I had been wondering a little about just what you were trying to accomplish;
I set tab stops in whatever source editor I'm using at the moment to get 
the indentation effect I prefer.Since there's code out there with many
levels on indentation, setting this every 3 spaces gives me the ability to
see more, while setting it to 8 is a bit more comfortable and less ambiguous. 

expand and unexpand permit some control, especially if you think of them as
filters. You can expand your code with the tab settings you like, and when
you're done debugging, unexpand the files to get the tabs back. Tab all you
like on input, then expand in the spaces you want to see later. This is gross, 
perhaps crude control, but it will work. You want to use it sparingly, since 
you're touching your files, and that will cause make to kick off a lot more
work than you might like...

However, some debuggers (and most file editors) support ways of changing 
tab settings, and there's some software that does code reformatting in 
various ways (I think one of them is clalled "tidy" and another one is 
called "prettyprint").

							Regards,
							---> RGB <---