]> code.delx.au - gnu-emacs/blobdiff - lisp/files.el
Merge from emacs-23
[gnu-emacs] / lisp / files.el
index ca698cab33dd732730f9443ab0844aac118bf6a9..3b130a20d2bcae76909dde50080f0ec328badd5d 100644 (file)
@@ -3224,7 +3224,10 @@ It is safe if any of these conditions are met:
    evaluates to a non-nil value with VAL as an argument."
   (or (member (cons sym val) safe-local-variable-values)
       (let ((safep (get sym 'safe-local-variable)))
-        (and (functionp safep) (funcall safep val)))))
+        (and (functionp safep)
+             ;; If the function signals an error, that means it
+             ;; can't assure us that the value is safe.
+             (with-demoted-errors (funcall safep val))))))
 
 (defun risky-local-variable-p (sym &optional ignored)
   "Non-nil if SYM could be dangerous as a file-local variable.