From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christian Schlauer Newsgroups: gmane.emacs.devel Subject: Applying file local variables -- why all-or-nothing? Date: Sat, 18 Aug 2007 09:50:34 +0200 Message-ID: Reply-To: cs-usenet@arcor.de NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187423721 716 80.91.229.12 (18 Aug 2007 07:55:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 18 Aug 2007 07:55:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 18 09:55:18 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IMJ9Q-00051p-3t for ged-emacs-devel@m.gmane.org; Sat, 18 Aug 2007 09:55:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IMJ9P-00089C-Ks for ged-emacs-devel@m.gmane.org; Sat, 18 Aug 2007 03:55:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IMJ9L-00087b-Dn for emacs-devel@gnu.org; Sat, 18 Aug 2007 03:55:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IMJ9J-00085i-Ug for emacs-devel@gnu.org; Sat, 18 Aug 2007 03:55:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IMJ9J-00085W-Ns for emacs-devel@gnu.org; Sat, 18 Aug 2007 03:55:09 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IMJ9J-0005PR-AZ for emacs-devel@gnu.org; Sat, 18 Aug 2007 03:55:09 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1IMJ9C-0004k0-DG for emacs-devel@gnu.org; Sat, 18 Aug 2007 09:55:02 +0200 Original-Received: from finn.gmane.org ([80.91.229.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Aug 2007 09:55:02 +0200 Original-Received: from cs-usenet by finn.gmane.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Aug 2007 09:55:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 79 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: finn.gmane.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76716 Archived-At: 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 .) -- Christian Schlauer