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

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

bug#20322: 25.0.50; indent-tabs-mode should default to nil


From: Drew Adams
Subject: bug#20322: 25.0.50; indent-tabs-mode should default to nil
Date: Wed, 15 Apr 2015 08:29:17 -0700 (PDT)

> Tabs make file smaller.  I just did an experiment.  In lread.c, M-x
> untabify changed 139702 characters into 155402 characters, which is
> 11% bigger.
> 
> For subr.el, it was smaller: 200817 characters became 209939, only
> 4.5% bigger.  However, files.el got 12% bigger.
> 
> If most of a git repository is text from various versions of files,
> the repository is also likely to get around 10% bigger without tabs,
> and now you're talking about 30 meg more.

That's a consideration, certainly.  But there are others - which is
why we have an option for this. ;-)  (FWIW, I've long turned off
`indent-tabs-mode', personally.)

Note that a (minor) problem for users can arise regardless of how a
user sets the option value: copying and pasting existing code from
a buffer where the option value was non-nil and where tab chars are
thus used for indentation.

When you paste a code snippet that you copied from Emacs (and perhaps
modified) into a help question reply (email, StackExchange, whatever)
- that is, you paste it into a non-Emacs environment - you can find
that the receiving environment does not handle tab chars the way you
might hope.

I find myself "bitten" by this from time to time, even though I've
pretty much learned the habit of using `untabify' first.  (E.g,
copy+yank to another buffer, untabify, then paste to the non-Emacs
application.)

Admittedly, this inconvenience is only minor.  But it is also not
obvious to some users what is going on (i.e., why they see what
they see).

FWIW, whether the default value gets changed or not is not important
to me, as a user.  I just wanted to mention this because I imagine
that there is more and more use of snippets taken from Emacs buffers
and pasted into other environments.  If you forget to use `untabify'
then you can find yourself reformatting the code in the destination
environment - a bother, even if a minor one.

And of course there are some users who might not ever become aware
of `untabify' and who share code in non-Emacs media in order to help
others.  It is a (minor) annoyance to have to reformat pasted code,
and some users might never figure out what is going on (tab chars
are invisible).

If the Emacs source code used only space chars for indenting then,
yes, that code would occupy more space.  But users copying and
pasting it outside of Emacs would not be surprised by the strange
indentation they sometimes get.

And there is lots of 3rd-party code that is based on or derived
from core Emacs code.  Users copying 3rd-party code can thus be
bitten by this gotcha also, even if the 3rd-party maintainer
turns off `indent-tabs-mode' - if s?he does not use `untabify'.

Something to think about perhaps, in any case.  

[It is good that (emacs) `Just Space' mentions `untabify' along
with `indent-tabs-mode'.  It might be good for the Elisp manual
too to mention `untabify' where it documents `indent-tabs-mode'.]





reply via email to

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