From: Kaushal Modi <kaushal.modi@gmail.com>
To: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: enable-local-variables and emacs --batch
Date: Thu, 1 Nov 2018 10:54:02 -0400 [thread overview]
Message-ID: <CAFyQvY2psY45A-31Nz5aXwEhtcXgA5fH4Yp5RyKGmYNnos5_KQ@mail.gmail.com> (raw)
Hello,
I am unable to get the safe-marked variables to evaluate from
.dir-locals.el *only* when running emacs --batch.
For example, I have the below evaluated in emacs --batch --eval before
I load an Org file:
(put 'org-hugo-section 'safe-local-variable 'stringp)
And this in .dir-locals.el:
((org-mode . ((org-hugo-section . "foo"))))
But the org-hugo-section does not get set to "foo".
If I open an Org file in the directory with that .dir-locals.el in a
non-batch regular Emacs session, C-h v org-hugo-section shows that
it's set to "foo", and I get no prompts to apply/save that local
variable (as expected because I have marked it as
safe-local-variable).
So the only way I can make the .dir-locals.el apply that value is if I
do (setq enable-local-variables :all) when running emacs --batch.
But I don't consider that safe.
Why isn't the 'safe-local-variable attribute ignored only when running
emacs --batch?
My Emacs version: GNU Emacs 27.0.50 (build 34, x86_64-pc-linux-gnu,
GTK+ Version 2.24.23)
of 2018-10-31, built using commit 42681c54bf5ea2ff9d2a3ec6553766b194454caf.
Thanks.
--
Kaushal Modi
next reply other threads:[~2018-11-01 14:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-01 14:54 Kaushal Modi [this message]
2018-11-03 9:16 ` enable-local-variables and emacs --batch Eli Zaretskii
2018-11-03 10:05 ` Kaushal Modi
2018-11-03 10:46 ` Eli Zaretskii
2018-11-03 11:18 ` Kaushal Modi
2018-11-03 11:21 ` Kaushal Modi
2018-11-03 12:49 ` Kaushal Modi
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFyQvY2psY45A-31Nz5aXwEhtcXgA5fH4Yp5RyKGmYNnos5_KQ@mail.gmail.com \
--to=kaushal.modi@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.