diff options
| author | Richard M. Stallman | 1994-04-07 19:03:17 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-07 19:03:17 +0000 |
| commit | be0218a89c9a4c4434ba8fc138df729b4640b7c1 (patch) | |
| tree | 771095a53075394b3b6a9889b278e6d00d6df297 | |
| parent | 37fd966693b940b887726535b7be8d7a7ce25009 (diff) | |
| download | emacs-be0218a89c9a4c4434ba8fc138df729b4640b7c1.tar.gz emacs-be0218a89c9a4c4434ba8fc138df729b4640b7c1.zip | |
(hack-one-local-variable): Test for risky-local-variable property.
Put such properties on some variables, including minor-mode-map-alist.
| -rw-r--r-- | lisp/files.el | 8 |
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 | |||
| 1101 | '(enable-local-eval) | 1101 | '(enable-local-eval) |
| 1102 | "Variables to be ignored in a file's local variable spec.") | 1102 | "Variables to be ignored in a file's local variable spec.") |
| 1103 | 1103 | ||
| 1104 | ;; Get confirmation before setting these variables as locals in a file. | ||
| 1105 | (put 'eval 'risky-local-variable t) | ||
| 1106 | (put 'file-name-handler-alist 'risky-local-variable t) | ||
| 1107 | (put 'minor-mode-map-alist 'risky-local-variable t) | ||
| 1108 | (put 'after-load-alist 'risky-local-variable t) | ||
| 1109 | |||
| 1104 | ;; "Set" one variable in a local variables spec. | 1110 | ;; "Set" one variable in a local variables spec. |
| 1105 | ;; A few variable names are treated specially. | 1111 | ;; A few variable names are treated specially. |
| 1106 | (defun hack-one-local-variable (var val) | 1112 | (defun hack-one-local-variable (var val) |
| @@ -1111,7 +1117,7 @@ If `enable-local-variables' is nil, this function does not check for a | |||
| 1111 | nil) | 1117 | nil) |
| 1112 | ;; "Setting" eval means either eval it or do nothing. | 1118 | ;; "Setting" eval means either eval it or do nothing. |
| 1113 | ;; Likewise for setting hook variables. | 1119 | ;; Likewise for setting hook variables. |
| 1114 | ((or (memq var '(eval file-name-handler-alist after-load-alist)) | 1120 | ((or (get var 'risky-local-variable) |
| 1115 | (string-match "-hooks?$\\|-functions?$\\|-forms?$" | 1121 | (string-match "-hooks?$\\|-functions?$\\|-forms?$" |
| 1116 | (symbol-name var))) | 1122 | (symbol-name var))) |
| 1117 | (if (and (not (string= (user-login-name) "root")) | 1123 | (if (and (not (string= (user-login-name) "root")) |