all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tino Calancha <f92capac@gmail.com>
To: 23680@debbugs.gnu.org
Subject: bug#23680: 25.1.50; ibuffer: unmark all buffers without confirmation
Date: Thu, 2 Jun 2016 23:41:39 +0900 (JST)	[thread overview]
Message-ID: <alpine.LRH.2.20.1606022338220.3496@calancha-ilc.kek.jp> (raw)


It is a nuisance to be asked for confirmation whenever
an user wants to unmark all buffers.

I)
The patch follow same approach as Dired: introduce a new
command which unmark all buffers without confirmation.

II)
It is easier to remember if Ibuffer use the same bindings as
the Dired analog commands.  This patch rebind 'U' to the new
command introduced in I); for 'ibuffer-do-replace-regexp',
originally bound to 'U', prefers 'r'.

In GNU Emacs 25.1.50 (x86_64-pc-linux-gnu, GTK+ Version 3.20.5)
Repository revision: 6b985764f07ae164d8142ba64774f2beb2856ca8


From e3414a65e775a1de542e81fbb3c2b80dd381c446 Mon Sep 17 00:00:00 2001
From: Tino Calancha <f92capac@gmail.com>
Date: Thu, 2 Jun 2016 23:13:54 +0900
Subject: [PATCH 1/2] Ibuffer: unmark all buffers without confirmation

* lisp/ibuffer.el (ibuffer-unmark-all-marks): New command.
(ibuffer-mouse-popup-menu, ibuffer-mode): Use it.
(ibuffer-mode-map): Bind it to '**' and 'M-DEL'.
---
  lisp/ibuffer.el | 19 ++++++++++++-------
  1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index dd2687c..20b224c 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -469,8 +469,8 @@ ibuffer-mode-map
      (define-key map (kbd "M-s a M-C-s") 'ibuffer-do-isearch-regexp)
      (define-key map (kbd "M-s a C-o") 'ibuffer-do-occur)
      (define-key map (kbd "DEL") 'ibuffer-unmark-backward)
-    (define-key map (kbd "M-DEL") 'ibuffer-unmark-all)
-    (define-key map (kbd "* *") 'ibuffer-unmark-all)
+    (define-key map (kbd "M-DEL") 'ibuffer-unmark-all-marks)
+    (define-key map (kbd "* *") 'ibuffer-unmark-all-marks)
      (define-key map (kbd "* M") 'ibuffer-mark-by-mode)
      (define-key map (kbd "* m") 'ibuffer-mark-modified-buffers)
      (define-key map (kbd "* u") 'ibuffer-mark-unsaved-buffers)
@@ -749,8 +749,8 @@ ibuffer-mode-map
      (define-key-after map [menu-bar mark mark-old-buffers]
        '(menu-item "Mark old buffers" ibuffer-mark-old-buffers
          :help "Mark buffers which have not been viewed recently"))
-    (define-key-after map [menu-bar mark unmark-all]
-      '(menu-item "Unmark All" ibuffer-unmark-all))
+    (define-key-after map [menu-bar mark unmark-all-marks]
+      '(menu-item "Unmark All buffers" ibuffer-unmark-all-marks))

      (define-key-after map [menu-bar mark dashes]
        '("--"))
@@ -967,8 +967,7 @@ ibuffer-mouse-popup-menu
  	      (popup-menu ibuffer-mode-groups-popup))
  	  (let ((inhibit-read-only t))
  	    (ibuffer-save-marks
-	      ;; hm.  we could probably do this in a better fashion
-	      (ibuffer-unmark-all ?\r)
+	      (ibuffer-unmark-all-marks)
  	      (save-excursion
  		(goto-char eventpt)
  		(ibuffer-set-mark ibuffer-marked-char))
@@ -1329,6 +1328,12 @@ ibuffer-unmark-all
  	 t)))))
    (ibuffer-redisplay t))

+(defun ibuffer-unmark-all-marks ()
+  "Remove all marks from all marked buffers in Ibuffer."
+  (interactive)
+  ;; hm.  we could probably do this in a better fashion
+  (ibuffer-unmark-all ?\r))
+
  (defun ibuffer-toggle-marks (&optional group)
    "Toggle which buffers are marked.
  In other words, unmarked buffers become marked, and marked buffers
@@ -2419,7 +2424,7 @@ ibuffer-mode
    `\\[ibuffer-unmark-forward]' - Unmark the buffer at point.
    `\\[ibuffer-unmark-backward]' - Unmark the buffer at point, and move to the
            previous line.
-  `\\[ibuffer-unmark-all]' - Unmark all marked buffers.
+  `\\[ibuffer-unmark-all-marks]' - Unmark all marked buffers.
    `\\[ibuffer-mark-by-mode]' - Mark buffers by major mode.
    `\\[ibuffer-mark-unsaved-buffers]' - Mark all \"unsaved\" buffers.
            This means that the buffer is modified, and has an associated file.
-- 
2.8.1

From a494c157111c3146c891a77e6b6d860b6bf2c702 Mon Sep 17 00:00:00 2001
From: Tino Calancha <f92capac@gmail.com>
Date: Thu, 2 Jun 2016 23:14:31 +0900
Subject: [PATCH 2/2] Bind ibuffer-unmark-all-marks to U

* lisp/ibuffer.el (ibuffer-mode-map):
Rebind 'ibuffer-do-replace-regexp' to 'r'.
---
  lisp/ibuffer.el | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 20b224c..95b9b8e 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -470,6 +470,7 @@ ibuffer-mode-map
      (define-key map (kbd "M-s a C-o") 'ibuffer-do-occur)
      (define-key map (kbd "DEL") 'ibuffer-unmark-backward)
      (define-key map (kbd "M-DEL") 'ibuffer-unmark-all-marks)
+    (define-key map (kbd "U") 'ibuffer-unmark-all-marks)
      (define-key map (kbd "* *") 'ibuffer-unmark-all-marks)
      (define-key map (kbd "* M") 'ibuffer-mark-by-mode)
      (define-key map (kbd "* m") 'ibuffer-mark-modified-buffers)
@@ -566,7 +567,7 @@ ibuffer-mode-map
      (define-key map (kbd "R") 'ibuffer-do-rename-uniquely)
      (define-key map (kbd "S") 'ibuffer-do-save)
      (define-key map (kbd "T") 'ibuffer-do-toggle-read-only)
-    (define-key map (kbd "U") 'ibuffer-do-replace-regexp)
+    (define-key map (kbd "r") 'ibuffer-do-replace-regexp)
      (define-key map (kbd "V") 'ibuffer-do-revert)
      (define-key map (kbd "W") 'ibuffer-do-view-and-eval)
      (define-key map (kbd "X") 'ibuffer-do-shell-command-pipe)
-- 
2.8.1






             reply	other threads:[~2016-06-02 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 14:41 Tino Calancha [this message]
     [not found] ` <handler.23680.B.146487832815586.ack@debbugs.gnu.org>
2016-07-03 13:01   ` bug#23680: Acknowledgement (25.1.50; ibuffer: unmark all buffers without confirmation) Tino Calancha
2016-07-03 13:03 ` bug#23680: (no subject) Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.20.1606022338220.3496@calancha-ilc.kek.jp \
    --to=f92capac@gmail.com \
    --cc=23680@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.