Subject: Re: bug#12259: Add delete-trailing-whitespace to list of safe eval forms

From: Glenn Morris <[email-masked]>
Date: Wed, 22 Aug 2012 12:24:43 -0400

Stefan Monnier wrote:

> Actually, I wonder whether we want to accept/encourage those uses
> instead of (add-hook 'before-save-hook 'delete-trailing-whitespace).

OT: I wouldn't encourage that either. :)
Blind application of such a hook has removed trailing whitespace that
was supposed to be there in the Emacs sources a few times.

> You don't have to write patches like this one.  You can just customize
> safe-local-eval-forms.  There is a problem, indeed, tho: if you
> customize this var and we later add things to it, you'll keep using your
> customized version and won't benefit from the expanded list.
> So we should keep the default value of safe-local-eval-forms as nil, and
> allow things like those add-hook some other way (e.g. a new var).

(add-to-list 'safe-local-eval-forms ...)

There's also the long-standing Todo item to create a "diff-list" custom
type http://debbugs.gnu.org/7812, and use it for such things.