[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: whitespace issues
From: |
Emanuel Berg |
Subject: |
Re: whitespace issues |
Date: |
Wed, 01 Jul 2015 01:25:42 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Rusi <rustompmody@gmail.com> writes:
> 1. Is it possible to have some sort of save-hook so
> that all leading (indentation) whitespace is cleaned
> up to space alone and tabs are removed?
Do this and indentation will be in whitespaces only:
(setq-default indent-tabs-mode nil)
Only in Makefiles you still get tabs - otherwise they
(the Makefiles) won't work.
But to answer your question, yes, you can use
`before-save-hook' and `untabify'.
If you want to add exceptions, it could look like
this:
(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'
But I think it is better to have the file as you edit
it be as close to the finished form as possible, and
not have it post-processed like that.
--
underground experts united
http://user.it.uu.se/~embe8573
- whitespace issues, Rusi, 2015/06/30
- Re: whitespace issues, Jorge A. Alfaro-Murillo, 2015/06/30
- Re: whitespace issues, Óscar Fuentes, 2015/06/30
- Re: whitespace issues, Ian Zimmerman, 2015/06/30
- Message not available
- Re: whitespace issues, Dan Espen, 2015/06/30
- Re: whitespace issues,
Emanuel Berg <=
- Message not available
- Message not available