all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* enable-local-variables and emacs --batch
@ 2018-11-01 14:54 Kaushal Modi
  2018-11-03  9:16 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Kaushal Modi @ 2018-11-01 14:54 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-11-03 12:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-01 14:54 enable-local-variables and emacs --batch Kaushal Modi
2018-11-03  9:16 ` 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

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.