[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enhancement request for cat

From: Bob Proulx
Subject: Re: enhancement request for cat
Date: Thu, 23 May 2002 22:14:32 -0600
User-agent: Mutt/1.3.28i

> Can you add -tabstop to cat or make it read an environment variable?
> I've always used tabstop=4 in vi. There might be others who don't use vi
> tabstop=8.

Huh, what, huh?  The 'cat' command knows nothing about tabs.  Or rather
nothing beyond the --host-tabs option which is really just a specialized
form of --show-non-printing.  The 'cat' concatenates files without any
processing at all.  Except that options have been added which do some
character conversions.  That really should have been left in a 'vis'
command.  But that is another story.

Your *terminal* displays tabs to the standard modulus 8 column.  That is
the function of the terminal.  No user space programs are involved
in that.  If you want to use the 'expand' program to change the contents
of the file and convert tabs to spaces then the expand program will take
a -t N option to use N as the display modulus.  But then you have real
spaces and no tabs.  In that mode the expand program is doing exactly
what you have asked the cat program to do.

  expand -t 4 file1 file2 > outfile

Note that discussing tabs chars being a multiple of anything other
than eight enters into the realm of a religous war.  They were defined
to be eight and no one here got to vote on that.  That vi allows you
to change the display modulus of tabs is really a misfeature in vi.
What your editor does when you enter the TAB key is not related to what
the terminal displays wehn it sees a tab char.  Configure your editor
to move to the next modulus 4 column and that is fine.  Can you tell
which side of the debate that I am on?  :-)

Instead of trying to change tabstops from the standard of 8 to something
else try setting shiftwidth to 4 and using autoindent mode.  That works
well in vi and still preserves the standard value of the character set.
I realize that many will object that they don't want to do that in vi
but the better options are emacs or vim which have better modes.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]