Function: kill-this-buffer

kill-this-buffer is an interactive and byte-compiled function defined in menu-bar.el.gz.

Signature

(kill-this-buffer)

Documentation

Kill the current buffer.

When called in the minibuffer, get out of the minibuffer using abort-recursive-edit.

This command can be reliably invoked only from the menu bar, otherwise it could decide to silently do nothing.

Probably introduced at or before Emacs version 24.3.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/menu-bar.el.gz
(defun kill-this-buffer ()	; for the menu bar
  "Kill the current buffer.
When called in the minibuffer, get out of the minibuffer
using `abort-recursive-edit'.

This command can be reliably invoked only from the menu bar,
otherwise it could decide to silently do nothing."
  (interactive)
  (cond
   ;; Don't do anything when `menu-frame' is not alive or visible
   ;; (Bug#8184).
   ((not (menu-bar-menu-frame-live-and-visible-p)))
   ((menu-bar-non-minibuffer-window-p)
    (kill-buffer (current-buffer)))
   (t
    (abort-recursive-edit))))