Subject: RE: [External] : bug#76248: [Feature Request] user-option for killing buffer in `quit-window'.

From: Drew Adams <[email-masked]>
Date: Thu, 13 Feb 2025 16:44:55 +0000

FWIW, I want to bury the buffer of a quit window, not kill it.
I remap bindings of `quit-window' to this, which I got from
Martin 10 years ago:

(defun quit-window-delete (&optional kill window)
  "Quit WINDOW, deleting it, and bury its buffer.
WINDOW must be a live window and defaults to the selected one.
With prefix argument KILL non-nil, kill the buffer instead of
burying it.

This is similar to the version of `quit-window' that Emacs had before
the introduction of `quit-restore-window'.  It ignores the information
stored in WINDOW's `quit-restore' window parameter.

It deletes the WINDOW more often, rather than switching to another
buffer in it.  If WINDOW is alone in its frame then the frame is
deleted or iconified, according to option `frame-auto-hide-function'."
  (interactive "P")
  (set-window-parameter window
                        'quit-restore
                        `(frame frame nil ,(current-buffer)))
  (quit-restore-window window (if kill 'kill 'bury))))