summaryrefslogtreecommitdiff
path: root/lisp/vc/diff-mode.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2020-02-06 00:38:53 +0200
committerJuri Linkov <juri@linkov.net>2020-02-06 00:38:53 +0200
commit09eed01afb4968a93247fb8eb7b5301a5bfb6342 (patch)
treeadc6d7dfbb588f8516b91ccee07584cf9a62d578 /lisp/vc/diff-mode.el
parent4a0a1145054db9ba71c48ae5c3d766a06e144887 (diff)
downloademacs-09eed01afb4968a93247fb8eb7b5301a5bfb6342.tar.gz
Wrap some set-auto-mode calls with delay-mode-hooks (bug#39190)
* lisp/gnus/mm-view.el (mm-display-inline-fontify): * lisp/vc/diff-mode.el (diff-syntax-fontify-props): * lisp/vc/vc.el (vc-find-revision-no-save): Add delay-mode-hooks around set-auto-mode calls to not run hooks that might assume buffer-file-name really associates buffer with a file.
Diffstat (limited to 'lisp/vc/diff-mode.el')
-rw-r--r--lisp/vc/diff-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 2dbab802086..d61c363c821 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2719,7 +2719,9 @@ hunk text is not found in the source file."
(cl-assert (null buffer-file-name))
(let ((enable-local-variables :safe) ;; to find `mode:'
(buffer-file-name file))
- (set-auto-mode)
+ ;; Don't run hooks that might assume buffer-file-name
+ ;; really associates buffer with a file (bug#39190).
+ (delay-mode-hooks (set-auto-mode))
;; FIXME: Is this really worth the trouble?
(when (and (fboundp 'generic-mode-find-file-hook)
(memq #'generic-mode-find-file-hook