mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* lisp/files.el (safe-local-variable-p): Gracefully handle errors.
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings): Simplify the safety predicate.
This commit is contained in:
parent
7bea8c7a92
commit
acef0722fc
3 changed files with 13 additions and 14 deletions
|
|
@ -3134,7 +3134,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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue