aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-05-18 08:53:21 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-05-18 08:53:21 +0200
commitd01d77204f727f5d814186d287180046039270e1 (patch)
treeb731d0ee529fa030a9908da8d2db32a1d57cbf3f /lisp
parent6c4c16942ab2f6a12b4670508ba7f8b9df541020 (diff)
magit--refresh-start-time: Make private and only let-bind
Diffstat (limited to 'lisp')
-rw-r--r--lisp/magit-diff.el2
-rw-r--r--lisp/magit-mode.el12
2 files changed, 7 insertions, 7 deletions
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 85459f6..663bc38 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2635,7 +2635,7 @@ function errors."
(defun magit-diff-expansion-threshold (section)
"Keep new diff sections collapsed if washing takes too long."
(and (magit-file-section-p section)
- (> (float-time (time-since magit-refresh-start-time))
+ (> (float-time (time-since magit--refresh-start-time))
magit-diff-expansion-threshold)
'hide))
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index e89d93b..e02e7a9 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1063,15 +1063,15 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'."
(with-current-buffer buffer (magit-refresh-buffer)))
(magit-run-hook-with-benchmark 'magit-post-refresh-hook))
-(defvar-local magit-refresh-start-time nil)
+(defvar-local magit--refresh-start-time nil)
(defun magit-refresh-buffer (&rest _ignore)
"Refresh the current Magit buffer."
(interactive)
- (setq magit-refresh-start-time (current-time))
- (let ((refresh (intern (format "%s-refresh-buffer"
- (substring (symbol-name major-mode) 0 -5))))
- (magit--refresh-cache (or magit--refresh-cache (list (cons 0 0)))))
+ (let ((magit--refresh-start-time (current-time))
+ (magit--refresh-cache (or magit--refresh-cache (list (cons 0 0))))
+ (refresh (intern (format "%s-refresh-buffer"
+ (substring (symbol-name major-mode) 0 -5)))))
(when (functionp refresh)
(when magit-refresh-verbose
(message "Refreshing buffer `%s'..." (buffer-name)))
@@ -1112,7 +1112,7 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'."
(set-buffer-modified-p nil))
(when magit-refresh-verbose
(message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name)
- (float-time (time-since magit-refresh-start-time)))))))
+ (float-time (time-since magit--refresh-start-time)))))))
(defun magit-profile-refresh-buffer ()
"Profile refreshing the current Magit buffer."