GNU bug report logs - #34765
26.1; with-temp-buffer should not run buffer-list-update-hook

Previous Next

Package: emacs;

Reported by: Alexander Miller <alexanderm <at> web.de>

Date: Tue, 5 Mar 2019 22:58:02 UTC

Severity: normal

Tags: fixed

Found in version 26.1

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Alexander Miller <alexanderm <at> web.de>
Cc: 34765 <at> debbugs.gnu.org
Subject: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook
Date: Wed, 06 Mar 2019 15:13:37 +0100
> I do no understand the use-case you have in mind here. with-temp-buffer
> serves to create a short-lived temporary buffer that is quickly disposed
> of again. When would such a buffer be shown anywhere?

I confused this 'with-output-to-temp-buffer'.  Maybe we should indeed
rebind 'buffer-list-update-hook' around the 'generate-new-buffer' and
'kill-buffer' calls of 'with-temp-buffer'.

>  > I'm afraid you have to dig further to find out how
>  > 'buffer-list-update-hook' precisely gets called here.
>
> Did that, turns out it's down to mode-line packages, both powerline and
> doom-modeline are advising select-window.

And do not preserve NORECORD?

> I'll create PRs for both.
>
>  > What was the issue there?
>
> Same feedback loop as described above, except it would only happen
> when a region was active in magit's status buffer. I had tracked
> the cause to a temp buffer deep inside magit's internals. Here's the
> github link:
> https://github.com/magit/magit/issues/3738#issuecomment-464520582

Maybe magit should simply try to reuse the same temporary buffer
instead of recreating it excessively.  Creating/killing temporary
buffers does not come without some overhead.

>  > Emacs 27 now has 'window-selection-change-functions', strongly
>  > tied to redisplay and triggering only when the window selection has
>  > changed since last redisplay. Maybe you could try that.
>
> This problem occurs in my treemacs package, so I cannot use a solution
> provided by a bleeding edge release, my modus operandi is to support the
> last 2 versions of emacs, so 25 and 26 (since stable distros like debian
> still use emacs 25). At any rate I have found the culprit in those modeline
> packages, so that point is solved.

I see.  But please try 'window-selection-change-functions' sooner or
later so we know whether it fixes these problems.

martin




This bug report was last modified 4 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.