]> git.eshelyaron.com Git - emacs.git/commitdiff
(hack-one-local-variable): Support safe-local-variable property.
authorRichard M. Stallman <rms@gnu.org>
Tue, 27 Sep 1994 22:59:50 +0000 (22:59 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 27 Sep 1994 22:59:50 +0000 (22:59 +0000)
(compile-command): Add safe-local-variable property.

lisp/files.el

index faea7f8a6e9175f4df0ac8ed9cfa28589feaf63a..8f5727ee6cc2d49a4482aabb8df59caa4844682a 100644 (file)
@@ -1169,6 +1169,9 @@ If `enable-local-variables' is nil, this function does not check for a
 (put 'outline-level 'risky-local-variable t)
 (put 'rmail-output-file-alist 'risky-local-variable t)
 
+;; This one is safe because the user gets to check it before it is used.
+(put 'compile-command 'safe-local-variable t)
+
 (defun hack-one-local-variable-quotep (exp)
   (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp))))
 
@@ -1183,8 +1186,10 @@ If `enable-local-variables' is nil, this function does not check for a
        ;; "Setting" eval means either eval it or do nothing.
        ;; Likewise for setting hook variables.
        ((or (get var 'risky-local-variable)
-            (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$"
-                          (symbol-name var)))
+            (and
+             (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-command$"
+                           (symbol-name var))
+             (not (get var 'safe-local-variable))))
         ;; Permit evaling a put of a harmless property
         ;; if the args do nothing tricky.
         (if (or (and (eq var 'eval)