branch: elpa/magit
commit ec031e946dacd19ff28e7cac6b9ad5d97f5df7eb
Author: Pengji Zhang <m...@pengjiz.com>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-revert-rev-file-buffer: Adapt to upstream changes
    
    In Emacs commit 9506b9392e, `define-globalized-minor-mode' was
    refactored, and in Emacs 30 only the function `MODE-enable-in-buffer' is
    added to `after-change-major-mode-hook'. So in this commit we remove
    both functions from the hook to avoid activating `diff-hl-mode'.
---
 lisp/magit-files.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index f8503c78909..ff74e622ccd 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -178,7 +178,8 @@ then only after asking.  A non-nil value for REVERT is 
ignored if REV is
     (let ((buffer-file-name magit-buffer-file-name)
           (after-change-major-mode-hook
            (seq-difference after-change-major-mode-hook
-                           '(global-diff-hl-mode-enable-in-buffers
+                           '(global-diff-hl-mode-enable-in-buffer ; Emacs >= 30
+                             global-diff-hl-mode-enable-in-buffers ; Emacs < 30
                              eglot--maybe-activate-editing-mode)
                            #'eq)))
       (normal-mode t))

Reply via email to