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

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

Re: whitespace-mode highlighting colour


From: michael-franzese
Subject: Re: whitespace-mode highlighting colour
Date: Mon, 4 Jan 2021 13:02:47 +0100

I do not want to modify the file, but highlight tabs and trailing spaces.

> Sent: Monday, January 04, 2021 at 4:57 PM
> From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: whitespace-mode highlighting colour
>
> michael-franzese wrote:
>
> > I want the highlight tabs and trailing spaces. You say that
> > the variable is obsolete.
> > How would be best to tackle the task.
>
> I guess it means one should use the face, not the variable.
>
> I do this so I don't have to bother with trailing whitespace or
> tabs. Maybe one can configure that in an easier way, because
> it feels like a basic thing to do.
>
> (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"
>
> (setq-default tab-width 3)
>
> (setq-default indent-tabs-mode nil)
>
> ;; (setq before-save-hook nil)
> (defun before-save-hook-f ()
>   (untab-all)
>   (delete-trailing-whitespace) )
> (add-hook 'before-save-hook #'before-save-hook-f)
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>
>



reply via email to

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