bug#81538: 32.0.50; Eglot: Non-local exit during window/showDocument handling

Troy Brown via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]> Wed, 5 Aug 2026 18:11:59 -0400
Newsgroups gmane.emacs.bugs
Message-ID <CABvCZ40OKzAxLaG1tE1c_dTxjzhSNHVTrKL33WkvzBXecZB=QQ@mail.gmail.com>
On Sun, Aug 2, 2026 at 3:14 PM João Távora <[email protected]> wrote:
>
> Please explain from top-to-bottom, in fact, explain just the
> problem from the top, period.  What do you type/click to make the
> problem happen?

I thought I had, but I'll try again.  I'm using
`eglot-execute-command` in my major mode to send an Ada Language
Server specific command, "als-other-window".  The server will respond
by asking Eglot to open a new file (via `window/showDocument`).  Eglot
uses `find-file-noselect` to open the buffer.  The non-local exit
happens during the `find-file-noselect` causing the buffer to be left
incompletely initialized and hidden.  The original email provides the
additional details from there about where the source of that non-local
exit originates.

> Also Eglot/Emacs versions are missing (at least from
> Eli'sq forwarded message)

Emacs: 32.0.50 (commit: 040b5a18fc3)
Eglot: 1.24

> And you know what's even better?  Explain clearly how to install this
> language server and setup a reproduction.

You can get the Ada Language Server from here:
https://github.com/AdaCore/ada_language_server/releases

This modified ERT test for my major mode exhibits the problem on my
machine quite often.  Because it's timing/buffering related, I don't
think it's guaranteed to fail every time though.  I had trouble
getting GitHub CI to reproduce the scenario, but I think the
performance characteristics of the runners are different.  Hopefully
it will fail for you though.  It seems to be about a 50/50 chance of
failing on my machine.  If it doesn't fail, I run the test again and
it usually fails the second time.

https://github.com/brownts/ada-ts-mode/blob/bug/81538/test/ada-ts-mode-eglot-tests.el#L130-L186

Troy.