all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Strozzi, David J." <strozzi2@llnl.gov>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: spacing of ls output in emacs shell
Date: Tue, 8 Mar 2011 13:06:50 -0800	[thread overview]
Message-ID: <C99BD982.369E%strozzi2@llnl.gov> (raw)
In-Reply-To: <AANLkTik6jsHahxpBU2tau9G+tBQ+pOMgnzFy32tNNm19@mail.gmail.com>

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" <pj@irregularexpressions.net> wrote:

>On Tue, Mar 8, 2011 at 10:25 AM, Strozzi, David J. <strozzi2@llnl.gov>
>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
>




  parent reply	other threads:[~2011-03-08 21:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 16:43 spacing of ls output in emacs shell Strozzi, David J.
2011-03-08 17:46 ` Valentin Plechinger
2011-03-08 18:25   ` Strozzi, David J.
2011-03-08 20:45     ` PJ Weisberg
2011-03-08 20:54       ` Valentin Plechinger
2011-03-08 21:06       ` Strozzi, David J. [this message]
2011-03-10  8:19     ` Jonathan Groll
     [not found] <mailman.7.1299602618.24943.help-gnu-emacs@gnu.org>
2011-03-08 17:49 ` Uday Reddy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C99BD982.369E%strozzi2@llnl.gov \
    --to=strozzi2@llnl.gov \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.