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

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

Re: Temporarily suppress a hook?


From: tomas
Subject: Re: Temporarily suppress a hook?
Date: Mon, 9 Jul 2018 08:00:11 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Jul 09, 2018 at 07:21:12AM +0200, Óscar Fuentes wrote:
> Skip Montanaro <skip.montanaro@gmail.com> writes:

[...]

> AFAIK, no. But you can use your own function instead of
> delete-trailing-whitespace:
> 
> (defun my-delete-trailing-whitespace ()
>   (interactive)
>   (unless my-special-buffer
>     (delete-trailing-whitespace)))

> (add-hook 'before-save-hook 'my-delete-trailing-whitespace)
> 
> Or advice delete-trailing-whitespace.

Or perhaps make the hook read a local variable you set in
the file (see "file local variables") and act accordingly.

This way you could declare whithin those special files that you
don't want trailing space removed.

Cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAltC+esACgkQBcgs9XrR2kYfqgCfSINQuXmDc0x0G8R49ru0b49N
dBUAnR1deWZTVdumkW8QpAGtObCxyYZc
=xV7B
-----END PGP SIGNATURE-----



reply via email to

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