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

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

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


From: Stefan Monnier
Subject: bug#12259: Add delete-trailing-whitespace to list of safe eval forms
Date: Thu, 23 Aug 2012 07:51:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

>> 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.

That's a different issue.  The question is not whether it's a good idea
for a user to use such a setting but:
- whether having such a setting in the file-(or directory-)local
  variables can be used as an attack vector.
- which hook to use.  And I believe before-save-hook is always the better
  choice here.

> (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.

Indeed for safe-local-eval-forms a simple diff-list would be sufficient
since safe-local-eval-forms is really a set (implemented as a list) so
we don't need to worry about ordering/repetitions/...
Could someone provide a patch for that?


        Stefan





reply via email to

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