diff options
| author | Richard M. Stallman | 1993-06-10 21:31:56 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-10 21:31:56 +0000 |
| commit | 7d3221d7e32e0c9b359d46fd7a74e0d5b220dbdd (patch) | |
| tree | 70a8f30bec978f97269fe5526b617dedbdcb8eca | |
| parent | c2225d0026d73b23be56993d1332096f02bdec0e (diff) | |
| download | emacs-7d3221d7e32e0c9b359d46fd7a74e0d5b220dbdd.tar.gz emacs-7d3221d7e32e0c9b359d46fd7a74e0d5b220dbdd.zip | |
(hack-one-local-variable): Treat ...-hook(s) and ..-function(s)
like setting the `eval' variable.
| -rw-r--r-- | lisp/files.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el index 37ad1c980bc..047bea3c2df 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1011,7 +1011,9 @@ If `enable-local-variables' is nil, this function does not check for a | |||
| 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 |
| @@ -1021,9 +1023,12 @@ If `enable-local-variables' is nil, this function does not check for a | |||
| 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) |