From aa9addfa93a58c52f368d7ccc2bbcd178bcb067c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 11 Apr 2006 17:58:58 +0000 Subject: [PATCH] (byte-compile-file): Bind enable-local-variables to :safe, and make normal-mode obey it. --- lisp/ChangeLog | 10 ++++++++++ lisp/emacs-lisp/bytecomp.el | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 52e2549235c..c965c89b76f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2006-04-11 Richard Stallman + + * emacs-lisp/bytecomp.el (byte-compile-file): + Bind enable-local-variables to :safe, and make normal-mode obey it. + + * files.el (enable-local-variables): Allow value :safe. + (normal-mode): Doc fix. + (hack-local-variables): Implement enable-local-variables = :safe. + (hack-local-variables-confirm): Don't prevent quitting. + 2006-04-11 Stefan Monnier * loadhist.el (unload-feature): A bit of sanity check of diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 83620f3344f..da284e94548 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1650,8 +1650,12 @@ The value is non-nil if there were no errors, nil if errors." ;; If they change the file name, then change it for the output also. (let ((buffer-file-name filename) (default-major-mode 'emacs-lisp-mode) + ;; Ignore unsafe local variables. + ;; We only care about a few of them for our purposes. + (enable-local-variables :safe) (enable-local-eval nil)) - (normal-mode) + ;; Arg of t means don't alter enable-local-variables. + (normal-mode t) (setq filename buffer-file-name)) ;; Set the default directory, in case an eval-when-compile uses it. (setq default-directory (file-name-directory filename))) -- 2.39.2