branch: elpa/magit
commit 10a0994ae8a3d2cd1ef5231c72f226cd71e79e68
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit--refresh-buffer-set-positions: No longer suppress unused hook
    
    `magit-section-goto-successor' no longer runs
    `magit-section-movement-hook', so we don't have to suppress it in
    `magit--refresh-buffer-set-positions'.  Since that hook was why we
    wanted to handle the selected window last, when it displayed the
    buffer being refreshed, we can also stop changing the order of the
    windows returned by ``magit--refresh-buffer-get-positions'.
---
 lisp/magit-mode.el | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 5b54945548..9249e524d5 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1120,11 +1120,7 @@ Run hooks `magit-pre-refresh-hook' and 
`magit-post-refresh-hook'."
                     `((,window
                        ,section
                        ,@(magit-section-get-relative-position section)))))))
-            ;; If it qualifies, then the selected window
-            ;; comes first, but we want to handle it last
-            ;; so that its `magit-section-movement-hook'
-            ;; run can override the effects of other runs.
-            (or (nreverse (get-buffer-window-list buffer nil t))
+            (or (get-buffer-window-list buffer nil t)
                 (list (selected-window))))))
 
 (defun magit--refresh-buffer-set-positions (positions)
@@ -1132,8 +1128,7 @@ Run hooks `magit-pre-refresh-hook' and 
`magit-post-refresh-hook'."
     (if (eq (current-buffer) (window-buffer window))
         (with-selected-window window
           (apply #'magit-section-goto-successor args))
-      (let ((magit-section-movement-hook nil))
-        (apply #'magit-section-goto-successor args)))))
+      (apply #'magit-section-goto-successor args))))
 
 (defun magit-revert-buffer (_ignore-auto _noconfirm)
   "Wrapper around `magit-refresh-buffer' suitable as `revert-buffer-function'."

Reply via email to