Subject: Re: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer

From: Raffael Stocker <[email-masked]>
Date: Fri, 09 Aug 2024 21:59:46 +0200

Raffael Stocker <[email-masked]> writes:

> Stefan Kangas <[email-masked]> writes:
>
>> `buffer-list' is documented to return a list of all live buffers, so it
>> would be good to understand why buffers are getting killed in this loop.
>>
>> In other words, are we sure that your patch is not just covering up some
>> problem elsewhere?
>
> I guess it is.  I just did some trying out and found that I can reliably
> make the problem appear and disappear by enabling/disabling eglot.
>
> I will spend some more time with this and see what more I can find out.

It seems the problem comes from me putting ‘which-function-mode’ into
‘prog-mode-hook’, which I probably shouldn't have done.  Each time I
load a file in some prog-mode while eglot is active managing at least
one buffer, which-function-mode seems to get re-enabled and cause my
problems.  If I just globally enable it (as I probably should do), this
doesn't happen.

In short, seems to be a pilot error.
Why I still can't reproduce it with ‘emacs -Q’, I do not know.
Still, not worth a patch it seems, sorry for the noise.