Function: Buffer-menu-delete

Buffer-menu-delete is an interactive and byte-compiled function defined in buff-menu.el.gz.

Signature

(Buffer-menu-delete &optional ARG)

Documentation

Mark the buffer on this Buffer Menu buffer line for deletion.

A subsequent x (Buffer-menu-execute) command will delete it.

If prefix argument ARG is non-nil, it specifies the number of buffers to delete; a negative ARG means to delete backwards.

When outline-minor-mode(var)/outline-minor-mode(fun) is enabled and point is on the outline heading line, this command will mark all entries in the outline. However, ARG is not supported in this case.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/buff-menu.el.gz
(defun Buffer-menu-delete (&optional arg)
  "Mark the buffer on this Buffer Menu buffer line for deletion.
A subsequent \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command \
will delete it.

If prefix argument ARG is non-nil, it specifies the number of
buffers to delete; a negative ARG means to delete backwards.

When `outline-minor-mode' is enabled and point is on the outline
heading line, this command will mark all entries in the outline.
However, ARG is not supported in this case."
  (interactive "p" Buffer-menu-mode)
  (cond
   ((and (bound-and-true-p outline-minor-mode) (outline-on-heading-p))
    (let ((limit (save-excursion (outline-end-of-subtree) (point)))
          ;; Skip outline subheadings on recursive calls
          (outline-minor-mode nil))
      (forward-line)
      (while (< (point) limit)
        (Buffer-menu-delete))))
   (t
    (if (or (null arg) (= arg 0))
        (setq arg 1))
    (while (> arg 0)
      (when (Buffer-menu-buffer)
        (tabulated-list-set-col 0 (char-to-string Buffer-menu-del-char) t))
      (forward-line 1)
      (setq arg (1- arg)))

    (while (< arg 0)
      (when (Buffer-menu-buffer)
        (tabulated-list-set-col 0 (char-to-string Buffer-menu-del-char) t))
      (forward-line -1)
      (setq arg (1+ arg))))))