This thread contains a patchset. You're looking at the original emails,
but you may wish to use the patch review UI.
Review patch
2
2
[PATCH guile-ares-rs 0/1] Consolidate spinner logic in one place, add pending request count
Take a look at this update, please. Just a sanity check, that I didn't forget
any cases or cause any performance issues.
Andrew Tropin (1):
Consolidate spinner logic in one place, add pending request count
arei-evaluation.el | 9 ++-------
arei-macroexpansion.el | 9 ++-------
arei.el | 16 +++++++++++-----
3 files changed, 15 insertions(+), 19 deletions(-)
--
2.45.2
[PATCH guile-ares-rs 1/1] Consolidate spinner logic in one place, add pending request count
---
arei-evaluation.el | 9 ++ -------
arei-macroexpansion.el | 9 ++ -------
arei.el | 16 +++++++++++ -----
3 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/arei-evaluation.el b/arei-evaluation.el
index 88584d3..065d694 100644
--- a/arei-evaluation.el
+++ b/arei-evaluation.el
@@ -90,11 +90,7 @@
:format fmt
:where (or expression-end (point))
:duration eros-eval-result-duration)
- (message fmt value))))
- ;; NOTE: stop spinner if it's the last request (we can have
- ;; multiple evals queued)
- (when (= 1 (hash-table-count arei-client--pending-requests))
- (arei-spinner-stop)))
+ (message fmt value)))))
(when (get-buffer-window)
(set-window-point (get-buffer-window) (buffer-size))))))))
@@ -119,8 +115,7 @@
(arei-client-send-request
request
(arei--process-user-eval-response-callback (current-buffer) end)
- (arei--user-evaluation-session-id))
- (ignore-errors (arei-spinner-start))))
+ (arei--user-evaluation-session-id))))
;;;
diff --git a/arei-macroexpansion.el b/arei-macroexpansion.el
index 1f561a2..1b1e28e 100644
--- a/arei-macroexpansion.el
+++ b/arei-macroexpansion.el
@@ -57,11 +57,7 @@
:format fmt
:where (or expression-end (point))
:duration eros-eval-result-duration)
- (message fmt expansion))))
- ;; NOTE: stop spinner if it's the last request (we can have
- ;; multiple evals queued)
- (when (= 1 (hash-table-count arei-client--pending-requests))
- (arei-spinner-stop)))
+ (message fmt expansion)))))
(when (get-buffer-window)
(set-window-point (get-buffer-window) (buffer-size)))))))
@@ -78,8 +74,7 @@
(arei-client-send-request
request
(arei--process-guile-macroexpand-response-callback (current-buffer) end)
- (arei--tooling-session-id))
- (ignore-errors (arei-spinner-start))))
+ (arei--tooling-session-id))))
(defun arei-macroexpand-last-sexp ()
(interactive)
diff --git a/arei.el b/arei.el
index 2676ceb..fdf157a 100644
--- a/arei.el
+++ b/arei.el
@@ -133,7 +133,6 @@ Development related and other commands:
(cl-defmethod sesman-quit-session ((_system (eql Arei)) session)
"Quit an Arei SESSION."
(let ((kill-buffer-query-functions nil))
- (arei-spinner-stop)
(kill-buffer (cadr session))))
@@ -262,10 +261,17 @@ this function directly."
(defun arei--modeline-connection-info ()
(list
"["
- (cond
- ((arei-spinner-modeline) (arei-spinner-modeline))
- ((arei-connected-p) "connected")
- (t "disconnected"))
+ (if (arei-connected-p)
+ (with-current-buffer (arei-connection-buffer)
+ (if (not (hash-table-empty-p arei-client--pending-requests))
+ (progn
+ (unless (arei-spinner-modeline) (arei-spinner-start))
+ (format "%s %s"
+ (car (arei-spinner-modeline))
+ (hash-table-count arei-client--pending-requests)))
+ (arei-spinner-stop)
+ "connected"))
+ (t "disconnected"))
"]"))
(defvar arei-mode-line
--
2.45.2
[guile-ares-rs/patches/.build.yml] build failed