Commit 77a43e01 authored by Richard M. Stallman's avatar Richard M. Stallman

(Buffer-menu-delete): Handle prefix arg.

(Buffer-menu-delete-backwards): Handle prefix; use Buffer-menu-delete.
parent 423c0dfa
...@@ -213,24 +213,35 @@ Optional ARG means move up." ...@@ -213,24 +213,35 @@ Optional ARG means move up."
(Buffer-menu-unmark) (Buffer-menu-unmark)
(forward-line -1)) (forward-line -1))
(defun Buffer-menu-delete () (defun Buffer-menu-delete (&optional arg)
"Mark buffer on this line to be deleted by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command." "Mark buffer on this line to be deleted by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command.
(interactive) Prefix arg is how many buffers to delete.
Negative arg means delete backwards."
(interactive "p")
(beginning-of-line) (beginning-of-line)
(if (looking-at " [-M]") ;header lines (if (looking-at " [-M]") ;header lines
(ding) (ding)
(let ((buffer-read-only nil)) (let ((buffer-read-only nil))
(delete-char 1) (if (or (null arg) (= arg 0))
(insert ?D) (setq arg 1))
(forward-line 1)))) (while (> arg 0)
(delete-char 1)
(defun Buffer-menu-delete-backwards () (insert ?D)
(forward-line 1)
(setq arg (1- arg)))
(while (< arg 0)
(delete-char 1)
(insert ?D)
(forward-line -1)
(setq arg (1+ arg))))))
(defun Buffer-menu-delete-backwards (&optional arg)
"Mark buffer on this line to be deleted by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command "Mark buffer on this line to be deleted by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command
and then move up one line" and then move up one line. Prefix arg means move that many lines."
(interactive) (interactive "p")
(Buffer-menu-delete) (Buffer-menu-delete (- (or arg 1)))
(forward-line -2) (while (looking-at " [-M]")
(if (looking-at " [-M]") (forward-line 1))) (forward-line 1)))
(defun Buffer-menu-save () (defun Buffer-menu-save ()
"Mark buffer on this line to be saved by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command." "Mark buffer on this line to be saved by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment