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

    magit-refresh-buffer: Reduce extend of a binding
---
 lisp/magit-mode.el | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 0735aef00d..4c8600dd89 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1078,27 +1078,27 @@ Run hooks `magit-pre-refresh-hook' and 
`magit-post-refresh-hook'."
     (when (functionp refresh)
       (when magit-refresh-verbose
         (message "Refreshing buffer `%s'..." (buffer-name)))
+      (deactivate-mark)
+      (setq magit-section-pre-command-section nil)
+      (setq magit-section-highlight-overlays nil)
+      (setq magit-section-selection-overlays nil)
+      (setq magit-section-highlighted-sections nil)
+      (setq magit-section-focused-sections nil)
       (let ((positions (magit--refresh-buffer-get-positions)))
-        (deactivate-mark)
-        (setq magit-section-pre-command-section nil)
-        (setq magit-section-highlight-overlays nil)
-        (setq magit-section-selection-overlays nil)
-        (setq magit-section-highlighted-sections nil)
-        (setq magit-section-focused-sections nil)
         (let ((inhibit-read-only t))
           (erase-buffer)
           (save-excursion
             (funcall refresh)))
-        (magit--refresh-buffer-set-positions positions)
-        (when created
-          (run-hooks 'magit--initial-section-hook)
-          (setq-local magit--initial-section-hook nil))
-        (let ((magit-section-cache-visibility nil))
-          (magit-section-show magit-root-section))
-        (run-hooks 'magit-refresh-buffer-hook)
-        (magit-section-update-highlight)
-        (set-buffer-modified-p nil)
-        (push (current-buffer) magit-section--refreshed-buffers))
+        (magit--refresh-buffer-set-positions positions))
+      (when created
+        (run-hooks 'magit--initial-section-hook)
+        (setq-local magit--initial-section-hook nil))
+      (let ((magit-section-cache-visibility nil))
+        (magit-section-show magit-root-section))
+      (run-hooks 'magit-refresh-buffer-hook)
+      (magit-section-update-highlight)
+      (set-buffer-modified-p nil)
+      (push (current-buffer) magit-section--refreshed-buffers)
       (when magit-refresh-verbose
         (message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name)
                  (float-time (time-since magit--refresh-start-time)))))))

Reply via email to