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


Message #35 received at 34765 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 34765 <at> debbugs.gnu.org, alexanderm <at> web.de,
 Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: Re: bug#34765: 26.1; with-temp-buffer should not run
 buffer-list-update-hook
Date: Tue, 23 Apr 2019 11:21:45 +0200
[Message part 1 (text/plain, inline)]
>  >> Maybe we should indeed rebind 'buffer-list-update-hook' around the
>  >> 'generate-new-buffer' and 'kill-buffer' calls of 'with-temp-buffer'.
>  >
>  > Wouldn't that be a backward-incompatible change?
>
> It would be a backward-incompatible change.
>
>  > How long did we call
>  > that hook for temporary buffers?
>
> Ever since that hook existed.
>
>  > Also, can generate-new-buffer and/or
>  > kill-buffer run some hooks which might modify other, non-temporary
>  > buffers?
>
> 'generate-new-buffer' calls 'get-buffer-create' and that one runs only
> 'buffer-list-update-hook'.  'kill-buffer' runs its usual hooks and if
> one of them runs 'kill-buffer' for another buffer we'd have a problem.
>
> An even more radical solution would be to never run
> 'buffer-list-update-hook' for buffers whose name starts with a space.
> Backward-incompatible as well but cleaner from a designer's POV.
>
> In either case it wouldn't help the OP since he probably (hopefully)
> won't need a solution for Emacs 27 (where he should be able to use
> 'window-selection-change-functions' instead) and we are certainly not
> going to change this for Emacs 26.

Stefan asked me to add a variable 'inhibit-buffer-list-update-hook'
and I came up with the attached.  WDYT?

martin
[inhibit-buffer-list-update-hook.diff (text/plain, attachment)]

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.