From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Mathieu Boespflug <mboes@tweag.net>
Cc: 12259@debbugs.gnu.org
Subject: bug#12259: Add delete-trailing-whitespace to list of safe eval forms
Date: Wed, 22 Aug 2012 10:36:29 -0400 [thread overview]
Message-ID: <jwvvcgbxeea.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <jwvr4qzxdzz.fsf-monnier+emacs@gnu.org>
> It seems as though, if evaluation forms that add 'time-stamp to various
> hooks that all run around the time a file is saved are deemed safe by
> default, surely evaluation forms that add 'delete-trailing-whitespace
> should equally be deemed safe by default.
Agreed, thanks.
> I have attached a patch at the end of this email that considers eval
> forms that add 'delete-trailing-whitespace to various hooks safe by
> default.
Actually, I wonder whether we want to accept/encourage those uses
instead of (add-hook 'before-save-hook 'delete-trailing-whitespace).
IOW I think we should only add the before-save-hook version but not
the others (and I guess the same holds for time-stamp, tho we'll
probably keep the other ones for time-stamp for backward-compatibility
reasons).
> But ideally this patch would be superseded by adding a mechanism that
> allows .dir-locals.el to add predefined functions to hooks (at least
> buffer local ones) without having to use eval.
Why?
> That way we wouldn't have to write patches such as this one for every
> new sensible stock function that people want to have executed on
> file saves.
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).
Stefan
next prev parent reply other threads:[~2012-08-22 14:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87r4r1e7i1.fsf@santiago.tweag.net>
2012-08-22 13:18 ` bug#12259: [Mathieu Boespflug] Add delete-trailing-whitespace to list of safe eval forms Stefan Monnier
2012-08-22 14:36 ` Stefan Monnier [this message]
2012-08-22 16:24 ` bug#12259: " Glenn Morris
2012-08-23 11:51 ` Stefan Monnier
2012-08-22 16:27 ` Mathieu Boespflug
2012-08-23 12:19 ` Stefan Monnier
2012-08-23 13:00 ` Mathieu Boespflug
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvvcgbxeea.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=12259@debbugs.gnu.org \
--cc=mboes@tweag.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).