From 699fb56b4e26aa2cffeec3292bf01c4ac5b11c44 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 14 Dec 2025 10:51:08 +0000 Subject: [PATCH] * lisp/vc/vc.el (vc-diff-internal): Use delay-mode-hooks. --- lisp/vc/vc.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index f210d440b69..b0821de3da5 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2799,13 +2799,15 @@ Return t if the buffer had changes, nil otherwise." ;; bindings are nicer for read only buffers. pcl-cvs does the ;; same thing. (setq buffer-read-only t) - (diff-mode) - (setq-local diff-vc-backend (car vc-fileset)) - (setq-local diff-vc-revisions (list rev1 rev2)) - (setq-local revert-buffer-function - (lambda (_ignore-auto _noconfirm) - (vc-diff-internal async vc-fileset rev1 rev2 verbose))) - (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async) + (delay-mode-hooks + (diff-mode) + (setq-local diff-vc-backend (car vc-fileset)) + (setq-local diff-vc-revisions (list rev1 rev2)) + (setq-local revert-buffer-function + (lambda (_ignore-auto _noconfirm) + (vc-diff-internal async vc-fileset rev1 rev2 verbose))) + (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async)) + (run-mode-hooks 'diff-mode-hook) (if (and (zerop (buffer-size)) (not (get-buffer-process (current-buffer)))) ;; Treat this case specially so as not to pop the buffer.