changeset 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 57174f9b1870
children 6895c2df25a6
files lisp/files.el
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Jun 10 21:15:55 1993 +0000
+++ b/lisp/files.el	Thu Jun 10 21:31:56 1993 +0000
@@ -1011,7 +1011,9 @@
 	((memq var ignored-local-variables)
 	 nil)
 	;; "Setting" eval means either eval it or do nothing.
-	((eq var 'eval)
+	;; Likewise for setting hook variables.
+	((or (eq var 'eval)
+	     (string-match "-hooks?$\\|-functions?$" (symbol-name var)))
 	 (if (and (not (string= (user-login-name) "root"))
 		  (or (eq enable-local-eval t)
 		      (and enable-local-eval
@@ -1021,9 +1023,12 @@
 			       (beginning-of-line)
 			       (set-window-start (selected-window) (point)))
 			     (setq enable-local-eval
-				   (y-or-n-p (format "Process `eval' local variable in file %s? "
+				   (y-or-n-p (format "Process `eval' or hook local variables in file %s? "
 						     (file-name-nondirectory buffer-file-name))))))))
-	     (save-excursion (eval val))
+	     (if (eq var 'eval)
+		 (save-excursion (eval val))
+	       (make-local-variable var)
+	       (set var val))
 	   (message "Ignoring `eval:' in file's local variables")))
 	;; Ordinary variable, really set it.
 	(t (make-local-variable var)