bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Basil L. Contovounesios
Subject: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook
Date: Sat, 19 Dec 2020 21:10:13 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Something like this?
>> 
>>   @cindex undo in temporary buffers
>>   @cindex @code{kill-buffer-hook} in temporary buffers
>>   @cindex @code{kill-buffer-query-functions} in temporary buffers
>>   @cindex @code{buffer-list-update-hook} in temporary buffers
>
> Yes.

Done.

>> >> +Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,,
>> >                                         ^^^^^^^^^^
>> > I think this word will look better if not capitalized.
>> 
>> The printed label "see Current Buffer" should be displayed instead of
>> this word, which is part of the anchor.  Is that okay?
>
> Sorry, I didn't see that this is an anchor.  So I think the anchor
> should not start with a capital letter, as it reads more naturally
> that way, I think.  And then the name should be used without
> capitalization in the cross-references.  Obviously, this is a minor
> nit.

I'm hesitant to change the anchor because all 37 such "Definition of..."
anchors in the tree are capitalised, as are the printed labels of all
their refs.

I'm happy to downcase them, but maybe this should be done wholesale in a
separate commit?

>> >> +static void
>> >> +run_buffer_list_update_hook (struct buffer *buf)
>> >> +{
>> >> +  if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks)))
>> >                                   ^^^
>> > Why this test? is it possible for this function to be called with buf
>> > a NULL pointer?
>> 
>> Yes, in Fmake_indirect_buffer, which doesn't check inhibit_buffer_hooks.
>> 
>> The alternatives would be for Fmake_indirect_buffer to not call
>> run_buffer_list_update_hook, or to not bother adding
>> run_buffer_list_update_hook at all.  Do you have a preference?
>
> I think just having a comment there saying that make-indirect-buffer
> calls this with NULL argument should be okay.

How's the attached?

Thanks,

-- 
Basil

Attachment: 0001-Inhibit-buffer-hooks-in-temporary-buffers.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]