From 704957437c0cbd3c361c477123bcb0026f9da7cf Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 Oct 2021 01:22:46 +0200 Subject: [PATCH] revert: Ignore unsafe local variables, but log them This behavior was too non-standard and invited more confusion than it helped. Ref #4070 Revert 5e7864838a7f --- modules/lang/emacs-lisp/config.el | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index 3efd82a36..faa0cd189 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -26,26 +26,6 @@ employed so that flycheck still does *some* helpful linting.") (use-package! elisp-mode :mode ("\\.Cask\\'" . emacs-lisp-mode) - :init - ;; Instead of pestering the user about accepting unsafe file local variables, - ;; I'd rather it quietly ignore them... - (setq-default enable-local-variables :safe) - ;; ...but still log them, so we can discover them if we're looking for it. - (defadvice! +emacs-lisp-log-unsafe-local-variables-a (variables dir-name) - :before #'hack-local-variables-filter - (when (eq enable-local-variables :safe) - (pcase-dolist (`(,var . ,val) variables) - (cond ((memq var ignored-local-variables)) - ((memq var '(mode unibyte coding))) - ((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)) - (message "Ignoring unsafe file local variable: %S" var)) - ((get var 'risky-local-variable) - (message "Ignoring risky file local variable: %S" var)))))) :config (set-repl-handler! '(emacs-lisp-mode lisp-interaction-mode) #'+emacs-lisp/open-repl) (set-eval-handler! '(emacs-lisp-mode lisp-interaction-mode) #'+emacs-lisp-eval)