Subject: bug#79065: 31.0.50; [PATCH] Allow inverting the meaning of 'quit-window-kill-buffer'

From: Eli Zaretskii <[email-masked]>
Date: Tue, 29 Jul 2025 13:44:23 +0300

> Date: Mon, 28 Jul 2025 11:56:26 -0700
> Cc: [email-masked]
> From: Jim Porter <[email-masked]>
> 
> On 7/28/2025 12:18 AM, martin rudalics via Bug reports for GNU Emacs, 
> the Swiss army knife of text editors wrote:
> > The problem with 'quit-window-kill-buffer' is that it also can be a list
> > of major modes.  What should 'invert' or 'xor' with or without a prefix
> > argument produce in such a case?  Kill the buffer if it is a member of
> > that list, kill it if it not a member of that list ...
> 
> My reasoning was that the prefix argument means, "Do the opposite of 
> what quit-window' would otherwise do." (Hence the name 'invert'.)
> 
> However, another way to do this would be a tri-state:
> 
> * no prefix: obey 'quit-window-kill-buffer'
> * C-u: always kill
> * C--: always bury
> 
> This avoids the 'invert' symbol entirely, and also avoids the additional 
> mental complexity of trying to predict what will happen when using the 
> prefix argument while 'quit-window-kill-buffer' is a list. (That 
> complexity is still there to a degree even without the prefix arg, but 
> it might be clearer for users to have a way of saying, "I want this 
> behavior," rather than just, "I want the opposite of the default.")

That might solve the interactive case (though maybe not in a very
convenient way), but what about calls from Lisp?