GNU bug report logs - #79065
31.0.50; [PATCH] Allow inverting the meaning of 'quit-window-kill-buffer'

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Mon, 21 Jul 2025 05:24:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Jim Porter <jporterbugs <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>, Juri Linkov <juri <at> linkov.net>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 79065 <at> debbugs.gnu.org
Subject: bug#79065: 31.0.50; [PATCH] Allow inverting the meaning of 'quit-window-kill-buffer'
Date: Mon, 28 Jul 2025 11:56:26 -0700
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.")

The above tri-state is something I do fairly often in my own Emacs 
config, though I'm not sure how common it is in Emacs itself. In this 
scheme, C-u means (very roughly) to do something "more" (e.g. more 
strongly), and C-- means the opposite: to do something "less", or in a 
diminished way. Since "C-u quit-window" in Emacs 30 is a stronger form 
of the default (quit the window *and* kill the buffer), "C-- 
quit-window" could mean the weaker form (quit the window and *never* 
kill the buffer).

From my PoV, I'd be happy with this scheme or the one I originally 
proposed. It would just involve relearning a bit of muscle memory.




This bug report was last modified 51 days ago.

Previous Next


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