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

From: Juri Linkov <[email-masked]>
Date: Mon, 28 Jul 2025 20:17:42 +0300

>> For example, 'windmove-display-no-select' has the same purpose,
>> but avoids the symbol 'invert' by using:
>>
>>    (xor (consp arg) windmove-display-no-select)
>>
>> Would it be possible to use the same logic here?
>
> 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 ...

Usually a per-mode value is defined by mode hooks like

  (add-hook 'Info-mode-hook (lambda () (setq-local quit-window-kill-buffer t)))

Then the prefix argument will invert the buffer-local value.