changeset 48007:c04620adce24

(risky-local-variable-p): VAL=nil has special meaning.
author Richard M. Stallman <rms@gnu.org>
date Sat, 26 Oct 2002 22:34:14 +0000
parents 9fb2295753ce
children 54e6db99ee89
files lisp/files.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Sat Oct 26 22:32:46 2002 +0000
+++ b/lisp/files.el	Sat Oct 26 22:34:14 2002 +0000
@@ -2061,7 +2061,8 @@
 (put 'compile-command 'safe-local-variable 'stringp)
 
 (defun risky-local-variable-p (sym val)
-  "Non-nil if SYM could be dangerous as a file-local variable with value VAL."
+  "Non-nil if SYM could be dangerous as a file-local variable with value VAL.
+If VAL is nil, the question is whether any value might be dangerous."
   (let ((safep (get sym 'safe-local-variable)))
     (or (memq sym ignored-local-variables)
 	(get sym 'risky-local-variable)
@@ -2071,7 +2072,8 @@
 	;; If the safe-local-variable property isn't t or nil,
 	;; then it must return non-nil on the proposed value to be safe.
 	(and (not (memq safep '(t nil)))
-	     (not (funcall safep val))))))
+	     (or (null val)
+		 (not (funcall safep val)))))))
 
 (defcustom safe-local-eval-forms nil
   "*Expressions that are considered \"safe\" in an `eval:' local variable.