GNU bug report logs - #4006
23.1.50; safe-local-variable-values

Previous Next

Package: emacs;

Reported by: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>

Date: Sat, 1 Aug 2009 20:50:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4006 in the body.
You can then email your comments to 4006 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4006; Package emacs. (Sat, 01 Aug 2009 20:50:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Dyballa <Peter_Dyballa <at> Freenet.DE>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 01 Aug 2009 20:50:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.1.50; safe-local-variable-values
Date: Sat, 1 Aug 2009 22:41:30 +0200
Hello!

My customisation contains since some days also an entry for an ispell  
dictionary (before it consisted of (AUC)TeX-command-default names):

	 '(safe-local-variable-values (quote ((ispell-dictionary .  
"english") (TeX-command-default . "XeLaTeX") (TeX-command-default .  
"XeTeX") (TeX-command-default . "XeLaTeXx") (TeX-command-default .  
"XeTeXx"))))

It was added by GNU Emacs by pressing ! to answer this question:

	The local variables list in Beispiel.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.)
	
	  * ispell-dictionary : "english"
	    mode : latex
	    TeX-master : t
	    TeX-command-default : "XeLaTeXx"

In the file I have this header:

	%%!TEX TS-program=xelatex -*- mode: LaTeX; coding: utf-8; ispell- 
dictionary: "english"; -*-
	%%!TEX encoding=UTF-8 Unicode
	%
	%	Time-stamp: <2009-07-28 12:42:50>
	%

In a second file have this local variables block:

	\end{document}
	%
	%%% Local Variables:
	%%% mode: LaTeX
	%%% fill-column: 99999
	%%% coding: utf-8-unix
	%%% ispell-dictionary: "english"
	%%% End:
	%
	%%

Actually I have pressed now many times ! and (ispell-dictionary .  
"english") is only once recorded! (Which is good!) When I open any of  
the LaTeX files after I have pressed y or n and check with C-h v I get:

safe-local-variable-values is a variable defined in `files.el'.
	Its value is
	((TeX-command-default . "XeLaTeX")
	 (TeX-command-default . "XeTeX")
	 (TeX-command-default . "XeLaTeXx")
	 (TeX-command-default . "XeTeXx"))
	
	
	  This variable is ignored when used as a file local variable.
	  This variable is potentially risky when used as a file local  
variable.
	
	Documentation:
	List variable-value pairs that are considered safe.
	Each element is a cons cell (VAR . VAL), where VAR is a variable
	symbol and VAL is a value that is considered safe.
	
	You can customize this variable.
	
	[back]

After having pressed ! I get at least:

	safe-local-variable-values is a variable defined in `files.el'.
	Its value is
	((ispell-dictionary . "english")
	 (TeX-command-default . "XeLaTeX")
	 (TeX-command-default . "XeTeX")
	 (TeX-command-default . "XeLaTeXx")
	 (TeX-command-default . "XeTeXx"))

and it works when I open the next LaTeX file. When I quit GNU Emacs I  
see that is writing into my init file. But it never uses this  
particular setting (the TeX-command-default's work fine).

I used Emacs.app for my test because it's a few hours younger and  
because I'll need to test a patch for an improved handling of native  
(Mac OS X) CJK input methods (not yet applied). The X client version  
acts exactly the same.

In GNU Emacs 23.1.50.1 (powerpc-apple-darwin8.11.0, NS apple- 
appkit-824.48)
 of 2009-08-01 on Latsche.local
Windowing system distributor `Apple', version 10.3.824
configured using `configure  '--without-sound' '--without-pop' '-- 
with-dbus' '--with-libotf' '--with-ns' '--disable-ns-self-contained'  
'--enable-locallisppath=/Library/Application Support/Emacs/ 
calendar23:/Library/Application Support/Emacs' 'PKG_CONFIG_PATH=/sw/ 
lib/freetype219/lib/pkgconfig:/sw/lib/pango-ft219/lib/pkgconfig:/sw/ 
lib/fontconfig2/lib/pkgconfig:/sw/lib/qt4-x11/lib/pkgconfig:/sw/lib/ 
xft2/lib/pkgconfig:/usr/X11R6/lib/pkgconfig:/sw/lib/pkgconfig:/sw/ 
share/pkgconfig:/usr/lib/pkgconfig:/sw/lib/system-openssl/lib/ 
pkgconfig:/sw/lib/fontforge/pkgconfig:/sw/lib/gcc4.2/lib/pkgconfig:/ 
usr/local/clamXav/lib/pkgconfig' 'CPPFLAGS=-no-cpp-precomp' 'CFLAGS=- 
ggdb3 -gfull -mtraceback=full -Wno-pointer-sign -H -pipe -fPIC - 
mcpu=7450 -mtune=7450 -fast -mpim-altivec -ftree-vectorize -foptimize- 
register-move -freorder-blocks -fthread-jumps -fpeephole -fno- 
crossjumping' 'LDFLAGS=-dead_strip -multiply_defined suppress''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: de_DE.UTF-8
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Dired by name

Minor modes in effect:
  auto-revert-mode: t
  TeX-PDF-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  tabbar-mwheel-mode: t
  tabbar-mode: t
  show-paren-mode: t
  display-time-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t


--
Greetings

  Pete

When people run around and around in circles we say they are crazy.  
When planets do it we say they are orbiting.






Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#4006; Package emacs. (Sat, 09 Jan 2010 19:13:02 GMT) Full text and rfc822 format available.

Message #8 received at 4006 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
Cc: 4006 <at> debbugs.gnu.org
Subject: Re: 23.1.50; safe-local-variable-values
Date: Sat, 09 Jan 2010 14:12:23 -0500
> My customisation contains since some days also an entry for an ispell
> dictionary (before it consisted of (AUC)TeX-command-default names).
> It was added by GNU Emacs by pressing ! to answer this question:
>
> 	The local variables list in Beispiel.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.)
>
> 	  * ispell-dictionary : "english"
> 	    mode : latex
> 	    TeX-master : t
> 	    TeX-command-default : "XeLaTeXx"

From "Specifying File Variables" in the Emacs manual:

   If `mode' is used to set a major mode, it should be the first
   "variable" in the list.  Otherwise, the entries that precede it will
   usually have no effect, since most major modes kill all local
   variables as part of their initialization.

That the problem you're seeing.

There is another bug entry in that database about adding a warning for
this kind of situation (Bug#5239).




bug closed, send any further explanations to Peter Dyballa <Peter_Dyballa <at> Freenet.DE> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sat, 09 Jan 2010 19:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <bug-gnu-emacs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Feb 2010 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 137 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.