GNU bug report logs -
#24880
26.0.50; buff-menu: Command to unmark all buffers
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sat, 5 Nov 2016 10:05:02 UTC
Severity: wishlist
Found in version 26.0.50
Done: Tino Calancha <tino.calancha <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 22 Nov 2016 15:30:32 +0900
with message-id <87h9706n7b.fsf <at> gmail.com>
and subject line bug#24880: 26.0.50; buff-menu: Command to unmark all buffers
has caused the debbugs.gnu.org bug report #24880,
regarding 26.0.50; buff-menu: Command to unmark all buffers
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
24880: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24880
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
I miss in this package a command to unmark all buffers bound to 'U'.
How about the following?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 1b7ff2820bd9e342a9f27c645fe961c06afaefc8 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sat, 5 Nov 2016 18:58:33 +0900
Subject: [PATCH] buff-menu: Command to unmark all buffers
* 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):
New command; cancel all requested operations on buffers. Bind it
to 'U'.
---
lisp/buff-menu.el | 13 +++++++++++++
lisp/emacs-lisp/tabulated-list.el | 6 ++++++
2 files changed, 19 insertions(+)
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 4742628..e920382 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -121,6 +121,7 @@ Buffer-menu-mode-map
(define-key map "\177" 'Buffer-menu-backup-unmark)
(define-key map "~" 'Buffer-menu-not-modified)
(define-key map "u" 'Buffer-menu-unmark)
+ (define-key map "U" 'Buffer-menu-unmark-all)
(define-key map "m" 'Buffer-menu-mark)
(define-key map "t" 'Buffer-menu-visit-tags-table)
(define-key map "%" 'Buffer-menu-toggle-read-only)
@@ -356,6 +357,18 @@ Buffer-menu-unmark
(Buffer-menu--unmark)
(forward-line (if backup -1 1)))
+(defun Buffer-menu-unmark-all ()
+ "Cancel all requested operations on buffers."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (when (tabulated-list-header-overlay-p)
+ (forward-line))
+ (while (not (eobp))
+ (unless (string= "." (aref (tabulated-list-get-entry) 0))
+ (tabulated-list-set-col 0 " " t))
+ (forward-line))))
+
(defun Buffer-menu-backup-unmark ()
"Move up and cancel all requested operations on buffer on line above."
(interactive)
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 00b029d..2757feb 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -257,6 +257,12 @@ tabulated-list-print-fake-header
(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'."
--
2.10.1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.2)
of 2016-11-05 built on calancha-pc
Repository revision: f95bf3cd1f55cf8f99b88c7318c21c967b11dfd1
[Message part 3 (message/rfc822, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
> Please give this a few more days, and if no further comments are
> posted, push to master.
Pushed to master branch as commit: 27b754c
This bug report was last modified 8 years and 188 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.