[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: martin rudalics
Subject: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook
Date: Thu, 07 Mar 2019 14:46:00 +0100

> 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.

Thanks.  IIUC this means that we'll have to put an extra warning in
the doc-string of 'buffer-list-update-hook' to not kill, rename or
create buffers or select another window with NORECORD nil in its
functions.  I listed all functions calling that hook in the hope that
people would then avoid that but your example shows that such endless
recursions can be quite tricky to detect.

One major design goal of the new window change functions was to simply
not invoke them recursively so such scenarios should not happen there
(and was immediately proven wrong by the redisplay mechanism itself).

>  > Can you pass me a corresponding URL?
> Did that already, Here it is again:
> https://github.com/magit/magit/issues/3738#issuecomment-464520582

I thought you had another one (with more insight into how that problem
triggered).  But the scenario above is sufficient to imagine what can
happen ...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]