help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: spacing of ls output in emacs shell


From: Strozzi, David J.
Subject: Re: spacing of ls output in emacs shell
Date: Tue, 8 Mar 2011 13:06:50 -0800
User-agent: Microsoft-MacOutlook/14.2.0.101115

Hi,

Thanks to all for your suggestions.  The upshot is the below solution
seems to still give tabs, but they are displayed as 8-space widths
regardless of the global value of tab-width.  To truly test this, make
sure you ls in a dir that has wide enough filenames that more than 8
spaces are needed between a short name in col. N and col. N+1.

Anyway, I have enough different ways to make ls behave nice that I am
happy.

I generally hate having actual tabs in text files, and try to always have
them expanded as spaces.  Precisely because sharing them among people or
editors wreaks havoc.  12 years ago I got Fortran 77 source with tabs, and
on Windoze a line got rendered as:

   ... x*cos(t)

where the * got pushed to column 73.  So, *cos(t) gets chopped off.  No
compiler error.  AND no numerical error at t=0.

No, I didn't stay up all night thinking up this corner case.  I
encountered it in the wild.  After one day and many curses, I learned to
hate tabs...

Dave

On 3/8/11 12:45 PM, "PJ Weisberg" <address@hidden> wrote:

>On Tue, Mar 8, 2011 at 10:25 AM, Strozzi, David J. <address@hidden>
>wrote:
>> Hi,
>>
>> Thanks for the suggestion.  I warn you that I am an emacs "user" and not
>> "master."  I put these exact lines in my .emacs, restarted, did M-x
>>shell,
>> ls, same thing - tabs appear in the ls output, and emacs interprets them
>> as giving about 4 spaces.
>>
>> Is there something else I need to do to enable this?
>>
>> I don't understand lisp, so I am not smart enough to think of what I
>>need
>> to do to adapt this to my environment.
>
>My suggestion would be to put
>
>(add-hook 'shell-mode-hook (lambda()
>                             (setq tab-width 8)))
>
>in your .emacs instead of the code Valentin suggested.  (I would test
>it, but 'ls' doesn't output any tabs in shell mode when I try it.)
>
>-PJ
>




reply via email to

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