Don't enable minor modes in diff-add-log-current-defuns

* lisp/vc/diff-mode.el (diff-add-log-current-defuns): Don't run mode
hooks when enabling major mode hooks.  That fails if, for example,
paredit-mode is on emacs-lisp-mode-hook and it signaled due to
unbalanced parens.
This commit is contained in:
Stefan Kangas 2025-02-26 04:36:51 +01:00
parent 2938afab36
commit 5397721352

View file

@ -2663,7 +2663,8 @@ are relative to the root directory of the VC repository."
(if other-buf (set-buffer other-buf)
(set-buffer (generate-new-buffer " *diff-other-text*"))
(insert (if applied old-text new-text))
(funcall (buffer-local-value 'major-mode buf))
(let ((delay-mode-hooks t))
(funcall (buffer-local-value 'major-mode buf)))
(setq other-buf (current-buffer)))
(goto-char (point-min))
(forward-line (+ =lines -1