From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#24880: 26.0.50; buff-menu: Command to unmark all buffers Date: Sat, 05 Nov 2016 19:04:15 +0900 Message-ID: <871syqnsyo.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1478340334 12756 195.159.176.226 (5 Nov 2016 10:05:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 5 Nov 2016 10:05:34 +0000 (UTC) To: 24880@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 05 11:05:30 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2xqZ-0000Wf-3a for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Nov 2016 11:05:11 +0100 Original-Received: from localhost ([::1]:43655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2xqc-0006ah-1K for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Nov 2016 06:05:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2xqV-0006Yn-Ps for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2016 06:05:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2xqQ-0004j2-Rz for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2016 06:05:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2xqQ-0004iw-OG for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2016 06:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c2xqQ-0005CT-J6 for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2016 06:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Nov 2016 10:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24880 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147834027519944 (code B ref -1); Sat, 05 Nov 2016 10:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Nov 2016 10:04:35 +0000 Original-Received: from localhost ([127.0.0.1]:45413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2xpy-0005Bc-PH for submit@debbugs.gnu.org; Sat, 05 Nov 2016 06:04:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2xpx-0005BR-Uu for submit@debbugs.gnu.org; Sat, 05 Nov 2016 06:04:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2xpr-0004Ao-Mb for submit@debbugs.gnu.org; Sat, 05 Nov 2016 06:04:28 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53085) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2xpr-0004Ab-JK for submit@debbugs.gnu.org; Sat, 05 Nov 2016 06:04:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2xpq-0006Sa-Dk for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2016 06:04:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2xpl-00043v-AD for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2016 06:04:26 -0400 Original-Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:33190) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2xpl-00042n-3U for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2016 06:04:21 -0400 Original-Received: by mail-pf0-x241.google.com with SMTP id 144so2026974pfv.0 for ; Sat, 05 Nov 2016 03:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version; bh=HhB9g4DxPyT3jJyte6Q915gxDPAHy8M9vTmVmAMs/uI=; b=LzqETHvgWdnGJdFDoC3lDZ3dG++W2/CL7URVcADYC+TfNi8gaxE8g3gM9l0pK0CO7j 8US+wzAJg+68k601v3IEJpfEoLu6rGR39yVBRd6nwm3jXodq572wFdifNW1ICwIKKI5M ej/HRNzKNPbQL65QVOVJUpun3/YAqDcVySBOMBgGKLTM2kzW6W5zULTsMa4kRU7ZKKb+ XtR/IM/yl2Q52UQaWG3nVFD57Km4amEXAfKR2X8wqUw4Xgk15Ds4pu2i+/4I3FgxncKm 7H0xsVXj8Z+bcg9eQWXBFUIbOqFaMZJl1/mqXCPvrIRcfkpnKNSa1TtCtgLb95zcIcJZ ID3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=HhB9g4DxPyT3jJyte6Q915gxDPAHy8M9vTmVmAMs/uI=; b=W2WIabuAgabojQxk6Q61o/OpfPTIIYv4xV2A78VOiGTO2mwQ+qCY3zrUwVpPJXJ2Xj bU1UhihfwaWmLxmmo3+LGcnfWbU6fJyT9pQU0np+Da8YUIVkkswt1M6KLxjQ61FV4lig s5T8iZGoLZ5K45D8UDkcp0a4X0WlIWRRGJLQXpI5QCnJRT46P0qWRiDkYkuj8feCi/M0 a3ur60piOcZouPI2JQYwH7ZexmBUaZG7Uq+vE5nLWSpgRUUZ/63UYqDjs10J/epI5zjJ WxQRKqHvnkQUtBUCCn/IdGbg3Fu6NNPGfgyzk1C4KU5nto4PRzrNTb72EW6j1rMR7OS/ 2bKg== X-Gm-Message-State: ABUngvehZiR7/iQMxH4BU9LZVLXU2WJc/7kEfsXgAqKnqXR6e8xN8vbGsOyyp7Ggs709Uw== X-Received: by 10.99.47.7 with SMTP id v7mr28892321pgv.15.1478340259788; Sat, 05 Nov 2016 03:04:19 -0700 (PDT) Original-Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id n7sm26316631pfn.62.2016.11.05.03.04.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Nov 2016 03:04:19 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125371 Archived-At: 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 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