comparison lisp/files.el @ 3626:ae0389767674

(hack-one-local-variable): Treat ...-hook(s) and ..-function(s) like setting the `eval' variable.
author Richard M. Stallman <rms@gnu.org>
date Thu, 10 Jun 1993 21:31:56 +0000
parents 386094c1a569
children 68ed205fc50e
comparison
equal deleted inserted replaced
3625:57174f9b1870 3626:ae0389767674
1009 (funcall (intern (concat (downcase (symbol-name val)) 1009 (funcall (intern (concat (downcase (symbol-name val))
1010 "-mode")))) 1010 "-mode"))))
1011 ((memq var ignored-local-variables) 1011 ((memq var ignored-local-variables)
1012 nil) 1012 nil)
1013 ;; "Setting" eval means either eval it or do nothing. 1013 ;; "Setting" eval means either eval it or do nothing.
1014 ((eq var 'eval) 1014 ;; Likewise for setting hook variables.
1015 ((or (eq var 'eval)
1016 (string-match "-hooks?$\\|-functions?$" (symbol-name var)))
1015 (if (and (not (string= (user-login-name) "root")) 1017 (if (and (not (string= (user-login-name) "root"))
1016 (or (eq enable-local-eval t) 1018 (or (eq enable-local-eval t)
1017 (and enable-local-eval 1019 (and enable-local-eval
1018 (save-window-excursion 1020 (save-window-excursion
1019 (switch-to-buffer (current-buffer)) 1021 (switch-to-buffer (current-buffer))
1020 (save-excursion 1022 (save-excursion
1021 (beginning-of-line) 1023 (beginning-of-line)
1022 (set-window-start (selected-window) (point))) 1024 (set-window-start (selected-window) (point)))
1023 (setq enable-local-eval 1025 (setq enable-local-eval
1024 (y-or-n-p (format "Process `eval' local variable in file %s? " 1026 (y-or-n-p (format "Process `eval' or hook local variables in file %s? "
1025 (file-name-nondirectory buffer-file-name)))))))) 1027 (file-name-nondirectory buffer-file-name))))))))
1026 (save-excursion (eval val)) 1028 (if (eq var 'eval)
1029 (save-excursion (eval val))
1030 (make-local-variable var)
1031 (set var val))
1027 (message "Ignoring `eval:' in file's local variables"))) 1032 (message "Ignoring `eval:' in file's local variables")))
1028 ;; Ordinary variable, really set it. 1033 ;; Ordinary variable, really set it.
1029 (t (make-local-variable var) 1034 (t (make-local-variable var)
1030 (set var val)))) 1035 (set var val))))
1031 1036