From: Stefan Kangas Date: Wed, 26 Feb 2025 03:36:51 +0000 (+0100) Subject: Don't enable minor modes in diff-add-log-current-defuns X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2c6bf13b38c845519a22c54961ef8da9e1d11f77;p=emacs.git 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. (cherry picked from commit 539772135222755255a3c8ca0cdda73dc4d742b2) --- diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 6d176b46f75..6a38ce3addd 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2625,7 +2625,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