From: Joost Kremers <joostkremers@fastmail.fm>
To: Titus von der Malsburg <malsburg@posteo.de>
Cc: emacs-devel@gnu.org
Subject: Re: Policy for declaring safe local variable values
Date: Fri, 08 Oct 2021 11:55:44 +0200 [thread overview]
Message-ID: <877denu95f.fsf@fastmail.fm> (raw)
In-Reply-To: <87bl3z98zk.fsf@posteo.de>
On Fri, Oct 08 2021, Titus von der Malsburg wrote:
> I have a configuration variable (in package bibtex-completion) that can usefully be set to a local value via a ‘Local Variable‘ comment in the file. E.g:
>
> # Local Variables:
> # bibtex-completion-bibliography: "/path/to/bibliography.bib"
> # End:
>
> However, it’s annoying that users have to confirm that the local value for this
> variable is safe every time they open a file with a different value for that
> variable.
Fun fact: answering your e-mail in Emacs I got the same question. :-)
> Question: Can I declare the variable safe for local values in my
> package, e.g.
>
> (put 'bibtex-completion-bibliography 'safe-local-variable (lambda (_) t))
>
> or would that violate Emacs conventions?
`defcustom` even has a keyword for it (`:safe`), so I don't think it violates
any conventions.
TBH, I use this method in some of my packages and it never occurred to me it
might be against conventions...
--
Joost Kremers
Life has its moments
next prev parent reply other threads:[~2021-10-08 9:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-08 9:11 Policy for declaring safe local variable values Titus von der Malsburg
2021-10-08 9:55 ` Joost Kremers [this message]
2021-10-08 14:51 ` Titus von der Malsburg
2021-10-08 15:06 ` Joost Kremers
2021-10-08 10:09 ` Lars Ingebrigtsen
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=877denu95f.fsf@fastmail.fm \
--to=joostkremers@fastmail.fm \
--cc=emacs-devel@gnu.org \
--cc=malsburg@posteo.de \
/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).