summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-04-07 19:03:17 +0000
committerRichard M. Stallman <rms@gnu.org>1994-04-07 19:03:17 +0000
commit90d6f1014ec53b7aca3eff720bac2aadee7d72e6 (patch)
tree0d847004ad664d4a898514e572cf19cc6de65efe /lisp
parent1073ad8b42fab8d5d5ec9d44ce202091e2b40c4b (diff)
downloademacs-90d6f1014ec53b7aca3eff720bac2aadee7d72e6.tar.gz
(hack-one-local-variable): Test for risky-local-variable property.
Put such properties on some variables, including minor-mode-map-alist.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index dc5d11e3229..0cd4a955403 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1101,6 +1101,12 @@ If `enable-local-variables' is nil, this function does not check for a
'(enable-local-eval)
"Variables to be ignored in a file's local variable spec.")
+;; Get confirmation before setting these variables as locals in a file.
+(put 'eval 'risky-local-variable t)
+(put 'file-name-handler-alist 'risky-local-variable t)
+(put 'minor-mode-map-alist 'risky-local-variable t)
+(put 'after-load-alist 'risky-local-variable t)
+
;; "Set" one variable in a local variables spec.
;; A few variable names are treated specially.
(defun hack-one-local-variable (var val)
@@ -1111,7 +1117,7 @@ If `enable-local-variables' is nil, this function does not check for a
nil)
;; "Setting" eval means either eval it or do nothing.
;; Likewise for setting hook variables.
- ((or (memq var '(eval file-name-handler-alist after-load-alist))
+ ((or (get var 'risky-local-variable)
(string-match "-hooks?$\\|-functions?$\\|-forms?$"
(symbol-name var)))
(if (and (not (string= (user-login-name) "root"))