GNU bug report logs - #78324
31.0.50; [Eglot] help-echo in code action indator doesn't indicate if there are more code actions available

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Fri, 9 May 2025 04:09:01 UTC

Severity: normal

Found in version 31.0.50

Done: Elijah Gabe Pérez <eg642616 <at> gmail.com>

To reply to this bug, email your comments to 78324 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to joaotavora <at> gmail.com, bug-gnu-emacs <at> gnu.org:
bug#78324; Package emacs. (Fri, 09 May 2025 04:09:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Elijah Gabe Pérez <eg642616 <at> gmail.com>:
New bug report received and forwarded. Copy sent to joaotavora <at> gmail.com, bug-gnu-emacs <at> gnu.org. (Fri, 09 May 2025 04:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; [Eglot] help-echo in code action indator doesn't indicate
 if there are more code actions available
Date: Thu, 08 May 2025 22:07:58 -0600
After 852d50e commit, the help-echo in eglot code action indicator
doesn't show the "(and %s more actions)".

I've also noticed that blurb was left unused.

#+begin_src diff
                                'face 'eglot-code-action-indicator-face
-                               'help-echo blurb
+                               'help-echo "mouse-1: execute code actions at point"
                                'mouse-face 'highlight
                                'keymap eglot-diagnostics-map))
              (save-excursion
#+end_src

Can be possible add also the actions available counter to help-echo?
As shown in this patch:

#+begin_src diff
@@ -4145,12 +4151,13 @@ eglot-code-action-suggestion
                     (eglot--format "\\[eglot-code-actions]: %s"
                                    (plist-get (aref actions 0) :title))))
              (if (>= (length actions) 2)
-                 (setq blurb (concat blurb (format "(and %s more actions)"
-                                                   (1- (length actions))))))
+                 (setq blurb (format "(%s more actions available)"
+                                     (1- (length actions)))))
              (setq tooltip
                    (propertize eglot-code-action-indicator
                                'face 'eglot-code-action-indicator-face
-                               'help-echo "mouse-1: execute code actions at point"
+                               'help-echo (concat "mouse-1: execute code actions at point"
+                                                  "\n" blurb)
                                'mouse-face 'highlight
                                'keymap eglot-diagnostics-map))
              (save-excursion
#+end_src

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78324; Package emacs. (Fri, 09 May 2025 08:46:02 GMT) Full text and rfc822 format available.

Message #8 received at 78324 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Cc: 78324 <at> debbugs.gnu.org
Subject: Re: bug#78324: 31.0.50; [Eglot] help-echo in code action indator
 doesn't indicate if there are more code actions available
Date: Fri, 09 May 2025 09:45:59 +0100
Elijah Gabe Pérez <eg642616 <at> gmail.com> writes:

> After 852d50e commit, the help-echo in eglot code action indicator
> doesn't show the "(and %s more actions)".

That's right.  And that's by design (didn't you test and greelight the
patch of bug#78106)?
>
> I've also noticed that blurb was left unused.

Look again.  It's used for ElDoc, there's a

   (funcall cb blurb)

further down.

> Can be possible add also the actions available counter to help-echo?
> As shown in this patch:
>
> #+begin_src diff
> @@ -4145,12 +4151,13 @@ eglot-code-action-suggestion
>                      (eglot--format "\\[eglot-code-actions]: %s"
>                                     (plist-get (aref actions 0) :title))))
>               (if (>= (length actions) 2)
> -                 (setq blurb (concat blurb (format "(and %s more actions)"
> -                                                   (1- (length actions))))))
> +                 (setq blurb (format "(%s more actions available)"
> +                                     (1- (length actions)))))
>               (setq tooltip
>                     (propertize eglot-code-action-indicator
>                                 'face 'eglot-code-action-indicator-face
> -                               'help-echo "mouse-1: execute code actions at point"
> +                               'help-echo (concat "mouse-1: execute code actions at point"
> +                                                  "\n" blurb)

This would break the current uses ElDoc . And if I follow your
intention, it would still be wrong, as if 3 actions were present it
would say sth like:

  mouse-1: execute code actions at point
  (2 more actions available)

which doesn't make sense.

In my opinion, there is nothing to do here.  The richer blurb is only
meant for the ElDoc outlet, because that points to a specific non-mouse
binding which will immediately execute the singleton action at point or
offer a menu of all actions.  The mouse bindings always offer the menu.

João




Reply sent to Elijah Gabe Pérez <eg642616 <at> gmail.com>:
You have taken responsibility. (Fri, 09 May 2025 14:56:01 GMT) Full text and rfc822 format available.

Notification sent to Elijah Gabe Pérez <eg642616 <at> gmail.com>:
bug acknowledged by developer. (Fri, 09 May 2025 14:56:02 GMT) Full text and rfc822 format available.

Message #13 received at 78324-done <at> debbugs.gnu.org (full text, mbox):

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: 78324-done <at> debbugs.gnu.org
Subject: Re: bug#78324: 31.0.50; [Eglot] help-echo in code action indator
 doesn't indicate if there are more code actions available
Date: Fri, 9 May 2025 08:54:59 -0600
[Message part 1 (text/plain, inline)]
João Távora <joaotavora <at> gmail.com> escribió:

> Elijah Gabe Pérez <eg642616 <at> gmail.com> writes:
>
> > After 852d50e commit, the help-echo in eglot code action indicator
> > doesn't show the "(and %s more actions)".
>
> That's right.  And that's by design (didn't you test and greelight the
> patch of bug#78106)?
>

Oops, right, i forgot that it's used in eldoc.

> Can be possible add also the actions available counter to help-echo?
> > As shown in this patch:
> >
> > #+begin_src diff
> > @@ -4145,12 +4151,13 @@ eglot-code-action-suggestion
> >                      (eglot--format "\\[eglot-code-actions]: %s"
> >                                     (plist-get (aref actions 0)
> :title))))
> >               (if (>= (length actions) 2)
> > -                 (setq blurb (concat blurb (format "(and %s more
> actions)"
> > -                                                   (1- (length
> actions))))))
> > +                 (setq blurb (format "(%s more actions available)"
> > +                                     (1- (length actions)))))
> >               (setq tooltip
> >                     (propertize eglot-code-action-indicator
> >                                 'face 'eglot-code-action-indicator-face
> > -                               'help-echo "mouse-1: execute code
> actions at point"
> > +                               'help-echo (concat "mouse-1: execute
> code actions at point"
> > +                                                  "\n" blurb)
>
> This would break the current uses ElDoc . And if I follow your
> intention, it would still be wrong, as if 3 actions were present it
> would say sth like:
>
>   mouse-1: execute code actions at point
>   (2 more actions available)
>
> which doesn't make sense.
>
> In my opinion, there is nothing to do here.  The richer blurb is only
> meant for the ElDoc outlet, because that points to a specific non-mouse
> binding which will immediately execute the singleton action at point or
> offer a menu of all actions.  The mouse bindings always offer the menu.
>

Fine, then I'm closing this.

>
[Message part 2 (text/html, inline)]

This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.