aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-27 22:59:50 +0000
committerRichard M. Stallman1994-09-27 22:59:50 +0000
commit6672c42bd1f7eeeca95eb239462bf3975109e0be (patch)
treeac40f5f7414b365ccefc06aff1485125702f1b43
parentcba9a9dcb1dee30b675cc5bb7077c09e8c4bf0f8 (diff)
downloademacs-6672c42bd1f7eeeca95eb239462bf3975109e0be.tar.gz
emacs-6672c42bd1f7eeeca95eb239462bf3975109e0be.zip
(hack-one-local-variable): Support safe-local-variable property.
(compile-command): Add safe-local-variable property.
-rw-r--r--lisp/files.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index faea7f8a6e9..8f5727ee6cc 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1169,6 +1169,9 @@ If `enable-local-variables' is nil, this function does not check for a
1169(put 'outline-level 'risky-local-variable t) 1169(put 'outline-level 'risky-local-variable t)
1170(put 'rmail-output-file-alist 'risky-local-variable t) 1170(put 'rmail-output-file-alist 'risky-local-variable t)
1171 1171
1172;; This one is safe because the user gets to check it before it is used.
1173(put 'compile-command 'safe-local-variable t)
1174
1172(defun hack-one-local-variable-quotep (exp) 1175(defun hack-one-local-variable-quotep (exp)
1173 (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp)))) 1176 (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp))))
1174 1177
@@ -1183,8 +1186,10 @@ If `enable-local-variables' is nil, this function does not check for a
1183 ;; "Setting" eval means either eval it or do nothing. 1186 ;; "Setting" eval means either eval it or do nothing.
1184 ;; Likewise for setting hook variables. 1187 ;; Likewise for setting hook variables.
1185 ((or (get var 'risky-local-variable) 1188 ((or (get var 'risky-local-variable)
1186 (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$" 1189 (and
1187 (symbol-name var))) 1190 (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$"
1191 (symbol-name var))
1192 (not (get var 'safe-local-variable))))
1188 ;; Permit evaling a put of a harmless property 1193 ;; Permit evaling a put of a harmless property
1189 ;; if the args do nothing tricky. 1194 ;; if the args do nothing tricky.
1190 (if (or (and (eq var 'eval) 1195 (if (or (and (eq var 'eval)