[Top][All Lists]

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

Re: replacement for whitespace-tab

From: Emanuel Berg
Subject: Re: replacement for whitespace-tab
Date: Tue, 24 Oct 2017 02:08:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Will Parsons wrote:

> I noticed that in one of my Emacs
> configurations I had customized the value of
> whitespace-tab to better distinguish visually
> tabs from spaces. When I did a C-h v on the
> variable (under Emacs 25.2) I got the message:
> This variable is obsolete since 24.4; use the
> face instead.

Use the face! :) ???

Just about the only use case where tabs are
around, for some arcane reason, is in the
makefiles. There, you can use the face
`makefile-space' so not to be fooled
by whitespaces.

However even that is not really necessary as
you can have that fixed when you save the file.
Which one should do before compile - right?

You can automate deleting tabs (converting them
to spaces) on save with the below stuff.
The function "untab-all" doesn't seem to be
needed anymore (or ever?) tho...

;; (setq before-save-hook nil)
(defun before-save-hook-f ()
  (delete-trailing-whitespace) )
(add-hook 'before-save-hook #'before-save-hook-f)

(setq-default indent-tabs-mode nil)

(setq-default tab-width 3)

(defun untab-all ()
  (unless (member major-mode '(makefile-gmake-mode
                               makefile-mode) ) ; exceptions
    (untabify (point-min) (point-max)))
  nil) ; tell "did not write buffer to disk"

underground experts united

reply via email to

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