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: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78530 <at> debbugs.gnu.org, Yuan Fu <casouri <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: Mon, 9 Jun 2025 00:19:36 +0100
On Sat, Jun 7, 2025 at 9:08 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> Ping!  João, any comments or suggestions?

I think the patch is definitely in the right direction, but it would make
even more sense if it checked if the "original buffer" is still live by
the time the lambda is called.  If it's not, probably the callback
lambda shouldn't get called.  This is why Eglot uses its own macro
eglot--when-buffer-live.

And this new "rule" should be encoded in the documentation (docstring
and/or manual).  No need for lots of text, just a note.

And we should think a little bit if we're breaking backward
compatibility.  Though I don't think we are: not many ElDoc clients are
relying on the fact that the buffer the callbacks are run in is somewhat
arbitrary.

Finally the patch could come with some changes to Eglot as well, because
this allows for eglot.el to be simplified.  But be careful: the way to
do this is to do the eldoc.el change bumping its :core package version,
and then make the eglot.el change bumping its Package-requires: eldoc
version.  That way we guarantee that older Emacsen pulling in new eglot.el
also pull in the new suitable eldoc.el.

Thanks,
João




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.