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

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

Re: Indenting with spaces rather than tabs


From: Robert Thorpe
Subject: Re: Indenting with spaces rather than tabs
Date: Sat, 30 Jan 2021 18:46:32 +0000

wael-zwaiter@gmx.com writes:

> Can I do as follows, so that tabs are removed when "dfv-untabify-state"
> is "true".
>
> (defvar dfv-untabify-state nil)
> (defun clean-before-save ()
>   "Removes trailing spaces and tabs upon exiting"
>
>   (delete-trailing-whitespace)
>   (when (dfv-untabify-state)
>       (unless (member major-mode '(makefile-gmake-mode makefile-mode))
>       (untabify (point-min) (point-max))) ))

Yes you can do that.  I think Mr.Berg gave some similar code in this
thread.

Be careful though about accidentally wrecking files.  I notice you've
exempted makefiles, which is a good idea.  You might want to exempt
more, like config files.

If you're doing work on a VC system with others then changing tabs
becomes a major irritation.  That's because it creates a lot of false
changes (i.e. line changes where the code hasn't really changed).

BR,
Robert Thorpe




reply via email to

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