Subject: Re: bug#76969: kill-buffer fails silently when a thread exists where it's current

From: Dmitry Gutov <[email-masked]>
Date: Sat, 9 Aug 2025 23:11:51 +0300

On 09/08/2025 15:20, Eli Zaretskii wrote:
>> Date: Fri, 1 Aug 2025 03:01:11 +0300
>> Cc:[email-masked],[email-masked]
>> From: Dmitry Gutov<[email-masked]>
>>
>> +@var{buffer-disposition} indicates what happens if the thread's current
>> +buffer is about to be killed.  If the value is @code{t}, it's not
>> +allowed.
> I'd say "killing the buffer is not allowed", because "it" might be
> ambiguous.
> 
>>             Any other value, including nil (which is the default), means
>                                          ^^^
> @code{nil}
> 
>> --- a/src/thread.h
>> +++ b/src/thread.h
>> @@ -143,6 +143,9 @@ #define lisp_eval_depth (current_thread->m_lisp_eval_depth)
>>     struct buffer *m_current_buffer;
>>   #define current_buffer (current_thread->m_current_buffer)
>>   
>> +  /* Decides whether the thread's current buffer can be killed.  */
>> +  Lisp_Object buffer_disposition;
> I think this change means ABI_VERSION in comp.c should be bumped.
> 
> Also, please move this member to before event_object, because the
> comment there says:
> 
>    /* event_object must be the last Lisp field.  */
> 
> which is consistent with how we allocate thread objects:
> 
>    struct thread_state *new_thread
>      = ALLOCATE_ZEROED_PSEUDOVECTOR (struct thread_state, event_object,
> 				    PVEC_THREAD);
> 
> Finally, this needs a NEWS entry.
> 
> With the above nits fixed, please feel free to install, and thanks.

Thanks! Done all that and pushed to master:

https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=07eb39f1132ceb15e80e7912445890faa8f5b78c

Now closing, and let's be on lookout for user feedback.