Function: magit-bury-or-kill-buffer

magit-bury-or-kill-buffer is an interactive and byte-compiled function defined in magit-files.el.

Signature

(magit-bury-or-kill-buffer &optional BURY-BUFFER)

Documentation

Bury the current buffer if displayed in multiple windows, else kill it.

With a prefix argument only bury the buffer even if it is only displayed in a single window.

If the buffer is used by an Ediff session, refuse to kill or bury just that buffer. That former would break the session and the latter makes little sense in this context. Instead offer to quit the whole session.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-files.el
(defun magit-bury-or-kill-buffer (&optional bury-buffer)
  "Bury the current buffer if displayed in multiple windows, else kill it.

With a prefix argument only bury the buffer even if it is only
displayed in a single window.

If the buffer is used by an Ediff session, refuse to kill or bury just
that buffer.  That former would break the session and the latter makes
little sense in this context.  Instead offer to quit the whole session."
  (interactive "P")
  (cond ((bound-and-true-p ediff-this-buffer-ediff-sessions)
         (ediff-quit nil))
        ((or bury-buffer (cdr (get-buffer-window-list nil nil t)))
         (bury-buffer))
        ((kill-buffer))))