aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2016-05-06 18:58:49 +0000
committerAlan Mackenzie2016-05-06 18:58:49 +0000
commit26171e02773b9b2383f412dd79d241385d2d20df (patch)
treeef3a323014b2477b6a3f309bfcf548e90c8d20be
parent81204b276f849b577a0ccd0b6175353dfa9e2a07 (diff)
downloademacs-26171e02773b9b2383f412dd79d241385d2d20df.tar.gz
emacs-26171e02773b9b2383f412dd79d241385d2d20df.zip
Correct hack-local-variables change from Thu May 5 11:05:49 2016 +0000
Prevent hack-local-variables being called from the fundamental-mode mode call early in normal-mode. This fixes bug #23460 and bug #23463. * lisp/files.el (normal-mode) Replace call to fundamental-mode with calls to the things it calls, with the exception of hack-local-variables. * etc/NEWS: Add an entry to note the calling of hack-local-variables at each major mode initialization.
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/files.el5
2 files changed, 9 insertions, 1 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 29559d143db..1d5d0d64584 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -156,6 +156,11 @@ probability of data corruption due to techniques Emacs uses to recover
156in these situations. 156in these situations.
157 157
158+++ 158+++
159** File local and directory local variables are now initialized each
160time the major mode is set, not just when the file is first visited.
161These local variables will thus not vanish on setting a major mode.
162
163+++
159** A second dir-local file (.dir-locals-2.el) is now accepted. 164** A second dir-local file (.dir-locals-2.el) is now accepted.
160See the variable 'dir-locals-file-2' for more information. 165See the variable 'dir-locals-file-2' for more information.
161 166
diff --git a/lisp/files.el b/lisp/files.el
index d89b2f52582..21f7bdc7dcf 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2316,7 +2316,10 @@ not set local variables (though we do notice a mode specified with -*-.)
2316or from Lisp without specifying the optional argument FIND-FILE; 2316or from Lisp without specifying the optional argument FIND-FILE;
2317in that case, this function acts as if `enable-local-variables' were t." 2317in that case, this function acts as if `enable-local-variables' were t."
2318 (interactive) 2318 (interactive)
2319 (fundamental-mode) 2319 (kill-all-local-variables)
2320 (unless delay-mode-hooks
2321 (run-hooks 'change-major-mode-after-body-hook
2322 'after-change-major-mode-hook))
2320 (let ((enable-local-variables (or (not find-file) enable-local-variables))) 2323 (let ((enable-local-variables (or (not find-file) enable-local-variables)))
2321 ;; FIXME this is less efficient than it could be, since both 2324 ;; FIXME this is less efficient than it could be, since both
2322 ;; s-a-m and h-l-v may parse the same regions, looking for "mode:". 2325 ;; s-a-m and h-l-v may parse the same regions, looking for "mode:".