Subject: [PATCH] Eglot: Display number of available code actions for mode-line
From: Elijah Gabe Pérez <[email-masked]>
To: [email-masked]
Date: Fri, 09 May 2025 13:14:36 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

I think it would be useful to have this in Eglot; lsp-mode and neovim
already provide something similar.

This is how it would look in the mode-line: [eglot:emacs/💡1]

From 4147a148ee0024b42bee09d593a403e7eb8edff2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <[email-masked]>
Date: Fri, 9 May 2025 12:59:14 -0600
Subject: [PATCH] Eglot: Display number of available code actions for mode-line

* lisp/progmodes/eglot.el (eglot-mode-line-action-suggestion):
Tweak.
---
 lisp/progmodes/eglot.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 04d3f74a6cb..b43acfadb4f 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2532,7 +2532,13 @@ eglot-mode-line-action-suggestion
     (when (and (memq 'mode-line eglot-code-action-indications)
                (overlay-buffer eglot--suggestion-overlay))
       (eglot--mode-line-props
-       eglot-code-action-indicator 'eglot-code-action-indicator-face
+       (concat eglot-code-action-indicator
+               (number-to-string
+                (length
+                 (overlay-get
+                  eglot--suggestion-overlay
+                  'eglot--actions))))
+       'eglot-code-action-indicator-face
        `((mouse-1
           eglot-code-actions-at-mouse
           "execute code actions at point")))))
-- 
2.49.0

-- 
                                          - E.G via GNU Emacs and Org.