unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 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

* Re: Applying file local variables -- why all-or-nothing?
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2007-08-19  0:45 UTC (permalink / raw)
  To: cs-usenet; +Cc: emacs-devel

    [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/.]

We discussed this whole subject previously.
We probably discussed this particular question;
didn't we?

If we did, I'd rather not reopen the question.
There are other things to do.

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

* Re: Applying file local variables -- why all-or-nothing?
  2007-08-19  0:45 ` Richard Stallman
@ 2007-08-20 20:29   ` Christian Schlauer
  2007-08-21 23:23     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Schlauer @ 2007-08-20 20:29 UTC (permalink / raw)
  To: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     [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/.]
>
> We discussed this whole subject previously.
> We probably discussed this particular question;
> didn't we?

I found two threads on gmane.org:

<http://thread.gmane.org/gmane.emacs.devel/49847/>:
From: Richard M. Stallman
Subject: Risky local variable mechanism
Newsgroups: gmane.emacs.devel
Date: 2006-01-31 23:09:31

<http://thread.gmane.org/gmane.emacs.devel/51377/>:
From: Andrew M. Scott
Subject: Clarification on using safe-local-variable-values
Newsgroups: gmane.emacs.devel
Date: 2006-03-08 19:55:59

> If we did, I'd rather not reopen the question.

I looked through the first thread and read the second thread
completely but didn't see anything related to the current
all-or-nothing approach.
-- 
Christian Schlauer

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

* Re: Applying file local variables -- why all-or-nothing?
  2007-08-20 20:29   ` Christian Schlauer
@ 2007-08-21 23:23     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2007-08-21 23:23 UTC (permalink / raw)
  To: cs-usenet; +Cc: emacs-devel

If it is easy subsequently to install all the variables
by typing M-x normal-mode, then I guess it is better to offer
the option of installing just the safe ones
in the initial question.

^ 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 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).