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

From: João Távora <[email-masked]>
Date: Wed, 17 Jul 2024 18:38:27 +0100

On Wed, Jul 17, 2024 at 6:25 PM Eshel Yaron <[email-masked]> wrote:
>
> João Távora <[email-masked]> writes:
>
> > 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?
>
> Yes, that's what I see.
>
> > Anyway, can you try this patch?
>
> That seems to work too :)

I understand the source of _this_ problem, and the line I changed
addresses it.  My worry is that my fix also creates more problems,
but it seems cleaner.  It has to be tested, particularly with Eglot reconnects.

Anyway the fix that someone proposed -- to refrain from issuing `flymake-mode`
when flymake-mode  is already active -- isn't right.  It's just
papering over a bug
waiting to appear again when someone does that in another mode hook.

The correct fix is similar to what I did, fixing the state management/cleanup
in flymake.el.  Maybe the reason for brutally resetting flymake--state doesn't
apply anymore: it doesn't seem right at all.

João