GNU bug report logs - #78530
31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer

Previous Next

Package: emacs;

Reported by: Yuan Fu <casouri <at> gmail.com>

Date: Wed, 21 May 2025 07:43:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: 78530 <at> debbugs.gnu.org
Cc: joaotavora <at> gmail.com
Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the  callback function in the original buffer
Date: Wed, 21 May 2025 00:42:21 -0700
[Message part 1 (text/plain, inline)]
X-Debbugs-CC: joaotavora <at> gmail.com

Copying from the commit message:

Some minor modes adds their own eldoc display function to
'eldoc-display-functions' hook buffer-locally.  So when eldoc
uses 'eldoc-display-functions' to display docs, it should use
the buffer-local value of the hook.

In 'eldoc--invoke-strategy', the code that runs
'eldoc-display-functions' hook is wrapped in a callback function
that eventually gets passed to each documentation function in
'eldoc-documentation-functions'. So now it's the documentation
functions' responsibility to call the eldoc callback in the
original buffer.

All the eglot documentation functions indeed do that, using
'eglot--when-buffer-window' to switch to the original buffer when
calling the eldoc callback. Except for
'eglot-code-action-suggestion'.

This patch fixes that.

This bug was originally reported on eldoc-box [1]. The user
found that eldoc-box's display function are rarely used, while
the minor mode is turned on. This patch fixes the issue.

[1] https://github.com/casouri/eldoc-box/issues/126#issuecomment-2896611278

I think we should fix the eldoc callback function so it always uses the
hook value of the hook in the original buffer; at the very least we
should document the pitfall in the docstring of
eldoc-documentation-functions. João, WDYT?

Yuan

[eglot-code-action.patch (application/octet-stream, attachment)]

This bug report was last modified 6 days ago.

Previous Next


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