Subject: Re: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook

From: Alexander Miller <[email-masked]>
Date: Thu, 7 Mar 2019 10:44:11 +0100

> So what was the problem there?  How did 'buffer-list-update-hook' get
 > invoked in such a wild manner

As I understand it: advising select-window served the purpose of
remembering the
current window so the modeline can be highlighted in tune with the
selection. The
advising code would also call force-mode-line-update, that in turn lead
to a re-calculation
of the frame title, in spacemacs this could in turn call format-spec,
that would use a
temp-buffer, that triggers buffer-list-update-hook, that triggers
treemacs' follow-mode
callback, that calls with-selected-window, that leads back to the
modeline's select-window
advice. That's more or less what the feedback loop looked like.

Come to think of it, maybe just suppressing the hook during my own
window-selection
will do the trick.

 > This alone qualifies as a bug IMHO.

You'll have to take that up with Jonas. I linked this discussion in
github, so he'll probably
read this.

 > I think that creating a new temporary buffer should always be the
 > exception and never the rule.  Does the point moving happen in the
 > treemacs buffer or in that of a plain (probably git-controlled)
 > buffer?

You misunderstood. The issue only happened when the treemacs window was
visible,
but point was in magit's status buffer and a region was active (e.g.
when you want to
select single lines for staging or reverting). Non-magit buffers had no
issues.

 > Can you pass me a corresponding URL?

Did that already, Here it is again:
https://github.com/magit/magit/issues/3738#issuecomment-464520582