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

From: Eli Zaretskii <[email-masked]>
Date: Mon, 30 Nov 2020 21:42:50 +0200

> From: "Basil L. Contovounesios" <[email-masked]>
> Cc: Lars Ingebrigtsen <[email-masked]>,  Eli Zaretskii <[email-masked]>,
>   [email-masked],  [email-masked],  [email-masked]
> Date: Mon, 30 Nov 2020 18:07:12 +0000
> 
> I'm slightly confused about the conclusion of this thread, though.
> You and Eli said it was too radical to set inhibit_buffer_hooks based
> on whether a buffer name starts with a space, as there may be legitimate
> cases where those hooks should run in a temporary buffer.
> 
> I accept this, but I don't see how setting inhibit_buffer_hooks based on
> a new optional argument to Fgenerate_new_buffer (and/or
> Fget_buffer_create) solves the problem entirely.
> 
> If I create a temporary buffer with the proposed
> 
>   (generate-new-buffer "foo" t)
> 
> then how do I later tell Emacs that this buffer's hooks should run?

The assumption is that you don't want to.  Recall that the original
idea was to turn the hooks off unconditionally based on the buffer's
name.  The above is a less drastic measure: it allows the code which
creates the buffer to request that regardless of the name.  But the
original motivation, that there are buffers where we want to never run
the hooks, is still valid.

> In other words, can we be sure that the buffers we choose to create with
> inhibit_buffer_hooks set will *never* need to later unset it?

We didn't see examples of such buffers, so we pretend they don't
exist.

> Should we expose a getter or setter for this buffer member

Not until someone comes up crying that this is needed, and presents a
convincing use case, IMO.