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 #62 received at 34765 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 34765 <at> debbugs.gnu.org, alexanderm <at> web.de, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#34765: 26.1;
 with-temp-buffer should not run buffer-list-update-hook
Date: Thu, 25 Apr 2019 09:01:01 -0400
> -    `(let ((,temp-buffer (generate-new-buffer " *temp*")))
> +    `(let ((,temp-buffer
> +	    (let ((inhibit-buffer-list-update-hook t))
> +              (generate-new-buffer " *temp*"))))
>         ;; FIXME: kill-buffer can change current-buffer in some odd cases.
>         (with-current-buffer ,temp-buffer
>           (unwind-protect
>  	     (progn ,@body)
>             (and (buffer-name ,temp-buffer)
> -                (kill-buffer ,temp-buffer)))))))
> +	        (let ((inhibit-buffer-list-update-hook t))
> +                  (kill-buffer ,temp-buffer))))))))

Hmm... I was thinking we could expose `inhibit_buffer_hooks` as a Lisp
variable (so we can set it without having to match names, which I find
ugly and brittle), but we'd want to `setq` it rather than let-bind it.
But while it's easy to set it before running kill-buffer, we can't set
it before calling generate-new-buffer :-(

How 'bout adding an optional argument to `generate-new-buffer` to set
`inhibit_buffer_hooks`?


        Stefan




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.