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: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: contovob <at> tcd.ie, 34765 <at> debbugs.gnu.org, monnier <at> IRO.UMontreal.CA, alexanderm <at> web.de
Subject: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook
Date: Wed, 22 May 2019 10:29:57 +0300
> From: martin rudalics <rudalics <at> gmx.at>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 34765 <at> debbugs.gnu.org, alexanderm <at> web.de,
>  monnier <at> IRO.UMontreal.CA
> Date: Tue, 21 May 2019 12:04:46 +0200
> 
> I have not managed to understand the Vcode_conversion_workbuf_name
> vs Vcode_conversion_reused_workbuf rigmarole yet.

The latter is a fixed buffer, created once and never killed.  So the
buffer hooks never run for it, and never affect Emacs.  By contrast,
the former is a buffer created when the reused buffer is busy and
cannot be reused.  We then kill Vcode_conversion_workbuf_name when we
no longer need it.  Thus, buffer hooks run for these work buffers all
the time, and for a code-conversion intensive code they could slow
down Emacs, specially if the list of buffer hooks is long.

> > The possibilities for the buffer creation subroutine are either to act
> > specially on certain buffer name prefixes, or to accept an extra
> > argument indicating what to do, no?  Are there any others?  There was
> > mention of exposing a buffer-local variable to Elisp, but IIRC setting
> > that after creating the buffer would already be too late.
> 
> So far there is no extra argument, the entire analysis is based on
> examining the proposed name argument.

Since we currently keep this special treatment limited to a small
number of buffer names, I'm not sure there's a need to expose this
facility to Lisp.

> > Buffer names starting with spaces are already special in some contexts,
> > so extending that idea for inhibiting buffer hooks doesn't sound too
> > bad,
> 
> Eli thinks that "this is too drastic a measure".

Yes.  No one said buffer hooks must _never_ run for temporary buffers.
There could be legitimate Lisp programs which want those hooks to run
in that case.




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

Previous Next


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