summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-06-23 21:48:27 +0000
committerRichard M. Stallman <rms@gnu.org>1992-06-23 21:48:27 +0000
commitd207b766c850f4adb0ed4994949b956b967e9314 (patch)
tree3e305691fad99eadf5258efcf63b2ff08ea60a95 /lisp/files.el
parentfd7b67ea6e3414b7b2ae5e67efdd6f55587bceb2 (diff)
downloademacs-d207b766c850f4adb0ed4994949b956b967e9314.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el29
1 files changed, 20 insertions, 9 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 2bc9e0a58d3..27c242b70da 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -171,11 +171,14 @@ nil means they are ignored; anything else means query.
The command \\[normal-mode] always obeys local-variables lists
and ignores this variable.")
-(defconst ignore-local-eval nil
- "*Non-nil means ignore the \"variable\" `eval' in a file's local variables.
-This applies when the local-variables list is scanned automatically
-after you find a file. If you explicitly request such a scan with
-\\[normal-mode], there is no query, regardless of this variable.")
+(defconst enable-local-eval nil
+ "*Control processing of the \"variable\" `eval' in a file's local variables.
+The value can be t, nil or something else.
+A value of t means obey `eval' variables;
+nil means ignore them; anything else means query.
+
+The command \\[normal-mode] always obeys local-variables lists
+and ignores this variable.")
;; Avoid losing in versions where CLASH_DETECTION is disabled.
(or (fboundp 'lock-buffer)
@@ -644,10 +647,18 @@ for current buffer."
(funcall (intern (concat (downcase (symbol-name val))
"-mode"))))
((eq var 'eval)
- (if (or ignore-local-eval
- (string= (user-login-name) "root"))
- (message "Ignoring `eval:' in file's local variables")
- (save-excursion (eval val))))
+ (if (and (not (string= (user-login-name) "root"))
+ (or (eq enable-local-eval t)
+ (and enable-local-eval
+ (save-window-excursion
+ (switch-to-buffer (current-buffer))
+ (save-excursion
+ (beginning-of-line)
+ (set-window-start (selected-window) (point)))
+ (y-or-n-p (format "Process `eval' local variable in file %s? "
+ (file-name-nondirectory buffer-file-name)))))))
+ (save-excursion (eval val))
+ (message "Ignoring `eval:' in file's local variables")))
(t (make-local-variable var)
(set var val))))))))))