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

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

spaces before tabs (yuck!)


From: Hikaru Ichijyo
Subject: spaces before tabs (yuck!)
Date: Tue, 03 Nov 2015 18:10:39 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

The question of tabs versus spaces is so notorious, it has its own
chapter in the Emacs manual.  Some people hate the confusion that tabs
cause them so much that they set indent-tabs-mode nil to make it so only
spaces are ever used, and there are no tabs anywhere.

I don't want to do that.  I just want to make it so Emacs will never
insert spaces unless the next character is either a visible/printable
one, or it is the end of the line.  In other words, no spaces before
tabs.

Recent versions of Nano actually highlight this in red by default:  If
Nano sees one or more spaces that are immediately followed by a tab, the
whitespace is shown in red reverse video.  It is considered undesirable
because the effect of such spaces is hard to predict.  If there are too
few of them to reach the next tab stop, they will do nothing (but waste
bytes).  If there are enough, they will push following tabs over.  It's
probably never a good thing.

Is there something I can set in my ~/.emacs globally to make Emacs
never, ever save space characters to a file if there is a tab character
immediately folowing it?  I can't think of a situation, either coding or
writing in human language, where I would ever want that.

-- 
He that would make his own liberty secure must guard even his enemy from
oppression; for if he violates this duty, he establishes a precedent
that will reach to himself.
                                        --Thomas Paine


reply via email to

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