Subject: bug#75401: 30.0.92; eglot-shutdown does not restore Flymake mode line indicator

From: Eli Zaretskii <[email-masked]>
Date: Thu, 09 Jan 2025 09:24:47 +0200

> From: Jake <[email-masked]>
> Date: Mon, 6 Jan 2025 11:52:54 +0000
> 
> This bug relates to Eglot and Flymake.  Demonstrating it requires a language server program.  I don't think
> it matters which, but I will give an example using python-mode and python-lsp-server (pylsp).
> 
> 1. emacs -Q
> 
> 2. Write the scratch buffer contents to a file with a python extension: C-x C-w /tmp/test.py
> 
> 3. M-x flymake-mode
> Note the Flymake indicator in the mode line is
> `Flymake:!`
> indicating that all backends are disabled [1].
> 
> 4. M-x eglot
> Note the Flymake indicator in the mode line changed because the LSP is providing Flymake diagnostic
> backends (I think they are pyflakes and pycodestyle in the case of pylsp). The mode line looks like:
> `Flymake[1 8]`
> indicating 1 error and 8 warnings.
> 
> 5. M-x eglot-shutdown
> Note the Flymake indicator is now
> `Flymake[0 0]`
> indicating no errors and no warnings.
> 
> According to the manual [2]:
> "Turning off Eglot means that it... restores the original values of the Emacs variables that Eglot changed
> when it was turned on."
> So the Flymake indicator should have returned to
> `Flymake:!`
> 
> Thanks
> Jake
> 
> [1] www.gnu.org/software/emacs/manual/html_node/flymake/Mode-line-status.html
> [2] www.gnu.org/software/emacs/manual/html_node/eglot/Shutting-Down-LSP-Servers.html

Spencer and João, could you please look into this issue?