GNU bug report logs - #76248
[Feature Request] user-option for killing buffer in `quit-window'.

Previous Next

Package: emacs;

Reported by: Elijah Gabe Perez <eg642616 <at> gmail.com>

Date: Thu, 13 Feb 2025 04:45:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>, Elijah Gabe Perez <eg642616 <at> gmail.com>
Cc: 76248 <at> debbugs.gnu.org
Subject: bug#76248: [Feature Request] user-option for killing buffer in `quit-window'.
Date: Thu, 13 Feb 2025 10:33:58 +0100
[Message part 1 (text/plain, inline)]
>> Hello, i would like to know why there is not an user-option for the
>> `quit-window' function to kill windows instead burying them.
                                  ^^^^^^^
				  buffers

>> I find this useful in buffers like `help-mode' to avoid filling
>> list-buffers with unnecessary buffers.
>>
>> I'm currently using an `advice' to achieve this:
>>
>>    (advice-add #'quit-window :around
>>                (lambda (orig-fn _ &rest window)
>>                  (funcall orig-fn 't window)))
>>
>> and honestly I would prefer an option like: "quit-window-kill-buffer"
>> (set to `nil' by default).
>
> I completely agree.  The lack of this option causes so much trouble.
> For example, I needed to define in the init file:
>
>    (defun quit-window-kill-buffer ()
>      "Quit WINDOW and kill its buffer."
>      (interactive)
>      (quit-window 1))
>
> and then update each and every keymap to override 'quit-window'
> with 'quit-window-kill-buffer':
>
>    (define-key archive-mode-map "q" 'quit-window-kill-buffer)
>    (define-key tar-mode-map "q" 'quit-window-kill-buffer)
>    (define-key dired-mode-map "q" 'quit-window-kill-buffer)
>    ...

I attach a patch that could simplify that.

martin
[quit-window-kill-buffer.diff (text/x-patch, attachment)]

This bug report was last modified 144 days ago.

Previous Next


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