Log unsafe eval forms in file/dir local variables

This commit is contained in:
Henrik Lissner 2021-04-26 20:00:41 -04:00
parent 44a501911b
commit ccf6f0b53d

View file

@ -37,7 +37,11 @@ employed so that flycheck still does *some* helpful linting.")
(pcase-dolist (`(,var . ,val) variables) (pcase-dolist (`(,var . ,val) variables)
(cond ((memq var ignored-local-variables)) (cond ((memq var ignored-local-variables))
((memq var '(mode unibyte coding))) ((memq var '(mode unibyte coding)))
((eq var 'eval)) ((eq var 'eval)
(and enable-local-eval
(not (or (hack-one-local-variable-eval-safep val)
(safe-local-variable-p var val)))
(message "Ignoring unsafe form in file local variable: %S" val)))
((not (safe-local-variable-p var val)) ((not (safe-local-variable-p var val))
(message "Ignoring unsafe file local variable: %S" var)) (message "Ignoring unsafe file local variable: %S" var))
((risky-local-variable-p var val) ((risky-local-variable-p var val)