* Applying file local variables -- why all-or-nothing?
@ 2007-08-18 7:50 Christian Schlauer
2007-08-19 0:45 ` Richard Stallman
0 siblings, 1 reply; 4+ messages in thread
From: Christian Schlauer @ 2007-08-18 7:50 UTC (permalink / raw)
To: emacs-devel
Hello!
[Short summary: the choice shouldn't be whether to apply /the local
variables list/ -- it should be whether to apply /those local
variables in the list that may not be safe/.]
,----[ C-h v enable-local-variables RET ]
| enable-local-variables is a variable defined in `files.el'.
| Its value is t
|
|
| Documentation:
| Control use of local variables in files you visit.
| The value can be t, nil, :safe, or something else.
|
| A value of t means file local variables specifications are obeyed
| if all the specified variable values are safe; if any values are
| not safe, Emacs queries you, once, whether to set them all.
`----
That is correct -- `emacs -q --no-site-file foo.tex' with foo.tex
containing
--8<---------------cut here---------------start------------->8---
\documentclass{article}
\begin{document}
foo
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
--8<---------------cut here---------------end--------------->8---
gives
--8<---------------cut here---------------start------------->8---
The local variables list in foo.tex
contains values that may not be safe (*).
Do you want to apply it? You can type
y -- to apply the local variables list.
n -- to ignore the local variables list.
! -- to apply the local variables list, and permanently mark these
values (*) as safe (in the future, they will be set automatically.)
mode : latex
* TeX-master : t
--8<---------------cut here---------------end--------------->8---
The problem is that one can _only_ apply or ignore the _whole_ local
variables list -- "whether to set them all" in the above doc-string.
Even if both the above doc-string and the window *Local Variables*
clearly say that the local variable _list_ is applied or ignored, TRT
(IMO) would be to
,----[ C-h v enable-local-variables RET ]
| [...]; if any values are not safe, Emacs applies the specified
| variable values that are safe and queries you, once, whether to set
| the ones that may not be safe.
`----
That would be much more what I'd expect: warn me about possibly unsafe
variables and ask me whether to apply *the unsafe ones* -- but treat
the safe ones as always when `enable-local-variables' is t: simply
apply them. The current "all-or-no-local-variables" approach is not
intuitive as safe local variables are always safe, no matter in what
"bad company" they are.
(The above leads to problems in AUCTeX with multifile documents where
an unsafe file local variable, together with pressing `n' when asked
about applying the local variables list, leads to AUCTeX not being
able to compile the multifile document, see
<http://permalink.gmane.org/gmane.emacs.auctex.devel/1939>.)
--
Christian Schlauer
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-08-21 23:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-18 7:50 Applying file local variables -- why all-or-nothing? Christian Schlauer
2007-08-19 0:45 ` Richard Stallman
2007-08-20 20:29 ` Christian Schlauer
2007-08-21 23:23 ` Richard Stallman
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.