From fde1a5ebeb5ff0f2a88d83f6c76984c8a4b19946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 11 Jan 2026 00:35:54 +0000 Subject: [PATCH] Eglot: de-spam eglot-mode-line-progress Too spammy when many progress reporters are created by servers such as rust-analyzer. * lisp/progmodes/eglot.el (eglot-mode-line-progress): Tweak. --- lisp/progmodes/eglot.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 8be88ab7316..f95451b35af 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2667,14 +2667,16 @@ still unanswered LSP requests to the server\n")))) (cl-loop for pr hash-values of (eglot--progress-reporters server) when (eq (car pr) 'eglot--mode-line-reporter) - collect (eglot--mode-line-props - (format "%s%%%%" (or (nth 4 pr) "?")) - 'eglot-mode-line - nil - (format "(%s) %s %s" (nth 1 pr) - (nth 2 pr) (nth 3 pr))) - into reports - finally (return (mapconcat #'identity reports " /"))))) + for v = (nth 4 pr) + when v sum 1 into n and sum v into acc + collect (format "(%s) %s %s" (nth 1 pr) (nth 2 pr) (nth 3 pr)) + into blurbs finally return + (unless (zerop n) + (eglot--mode-line-props + (format "%d%%%%" (/ acc n 1.0)) + 'eglot-mode-line + nil + (mapconcat #'identity blurbs "\n")))))) "Eglot mode line construct for LSP progress reports.") (defconst eglot-mode-line-action-suggestion