Subject: bug#69809: 30.0.50; flymake: error in process sentinel

From: João Távora <[email-masked]>
Date: Wed, 17 Jul 2024 14:44:11 +0100

On Wed, Jul 17, 2024 at 2:08 PM Eshel Yaron <[email-masked]> wrote:
>
> Hi João,
>
> João Távora <[email-masked]> writes:
>
> > On Wed, Jul 17, 2024 at 9:20 AM João Távora <[email-masked]> wrote:
> >>
> >> On Wed, Jul 17, 2024 at 7:12 AM Eshel Yaron <[email-masked]> wrote:
> >>
> >> > > Yes, this seems good for emacs-30.  Thanks Eshel!
> >> > Great, thanks.  Since this is a change in eglot.el, let me also ask João
> >> > before installing: João, any objections to the change above?
> >>
> >> I'd like to understand what problem it is solving.
> >
> > I've read a bit of the thread.  There seems to be an error involved,
> > but I didn't see a backtrace for this error.  Can someone produce it?
>
> Sure, here's one (also see the recipe I posted upthread):

Thanks. Is the backtrace below what's unequivocally (or close)
produced by that recipe?

Anyway, can you try this patch?

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index e72f25fd0cd..74db9b56dd9 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -991,7 +991,7 @@ flymake--highlight-line
 ;; third-party compatibility.
 (define-obsolete-function-alias 'flymake-display-warning 'message-box "26.1")

-(defvar-local flymake--state nil
+(defvar-local flymake--state (make-hash-table)
   "State of a buffer's multiple Flymake backends.
 The keys to this hash table are functions as found in
 `flymake-diagnostic-functions'.  The values are structures
@@ -1396,7 +1396,6 @@ flymake-mode
     ;; reinitializing `flymake--state' in the next line.
     ;; See https://github.com/joaotavora/eglot/issues/223.
     (mapc #'flymake--delete-overlay (flymake--really-all-overlays))
-    (setq flymake--state (make-hash-table))
     (setq flymake--recent-changes nil)

     (when flymake-start-on-flymake-mode (flymake-start t))