From 27b754cb4432ece3efe3fc9d8e52a869ae061b7f Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 22 Nov 2016 15:23:50 +0900 Subject: buff-menu: Add command to unmark all buffers Bind 'U' in buff-menu, bs and electric-buff-menu to commands to unmark all buffers (Bug#24880). * lisp/emacs-lisp/tabulated-list.el (tabulated-list-header-overlay-p): New predicate; return non-nil if tabulated-list has a fake header. * lisp/buff-menu.el (Buffer-menu-unmark-all-buffers): New command; remove all flags that use a particular mark from all the lines. Bind it to 'M-DEL'. (Buffer-menu-unmark-all): New command; remove all flags from all the lines. Bind it to 'U'. (Buffer-menu-marker-char, Buffer-menu-del-char): New variables. (Buffer-menu-delete, Buffer-menu-mark): Use them. (Buffer-menu-mode-map): Update menus. (Buffer-menu-mode): Update mode doc. * lisp/bs.el (bs-unmark-all, bs-unmark-previous): New commands. (bs-mode-map): Bind them to 'U' and '' respectively. (bs-mode): Update mode doc. * lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Bind Buffer-menu-unmark-all to 'U' and Buffer-menu-unmark-all-buffers to 'M-DEL'. (bs--down, bs-down, bs--up, bs-up, bs-unmark-current, bs-mark-current): Use point instead of cursor in doc string. (electric-buffer-list): Update mode doc. * doc/emacs/buffers.texi (Several Buffers): Mention Buffer-menu-unmark-all and Buffer-menu-unmark-all-buffers. ; * etc/NEWS: Add an entry per each new feature. --- lisp/emacs-lisp/tabulated-list.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index cf297f1ef4a..9523d5e89e3 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -259,6 +259,12 @@ Do nothing if `tabulated-list--header-string' is nil." (make-overlay (point-min) (point)))) (overlay-put tabulated-list--header-overlay 'face 'underline)))) +(defsubst tabulated-list-header-overlay-p (&optional pos) + "Return non-nil if there is a fake header. +Optional arg POS is a buffer position where to look for a fake header; +defaults to `point-min'." + (overlays-at (or pos (point-min)))) + (defun tabulated-list-revert (&rest ignored) "The `revert-buffer-function' for `tabulated-list-mode'. It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'." -- cgit v1.2.1