[PATCH v2 7/7] emacs: `notmuch-show-toggle-visibility-messages' with prefix arg filte...
authorPieter Praet <pieter@praet.org>
Wed, 22 Feb 2012 18:43:34 +0000 (19:43 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:50 +0000 (09:44 -0800)
4d/2a279eb798afdf6635752844ccdef059d583b2 [new file with mode: 0644]

diff --git a/4d/2a279eb798afdf6635752844ccdef059d583b2 b/4d/2a279eb798afdf6635752844ccdef059d583b2
new file mode 100644 (file)
index 0000000..6aa9901
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 15665431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 22 Feb 2012 10:46:15 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id cckw8weR4PF2 for <notmuch@notmuchmail.org>;\r
+       Wed, 22 Feb 2012 10:46:14 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ BAD50431FD5   for <notmuch@notmuchmail.org>; Wed, 22 Feb 2012 10:46:00 -0800\r
+ (PST)\r
+Received: by mail-ww0-f45.google.com with SMTP id dt12so311625wgb.2\r
+       for <notmuch@notmuchmail.org>; Wed, 22 Feb 2012 10:46:00 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of pieter@praet.org designates\r
+       10.180.74.177 as permitted sender) client-ip=10.180.74.177; \r
+Authentication-Results: mr.google.com;\r
+       spf=pass (google.com: domain of pieter@praet.org\r
+       designates 10.180.74.177 as permitted sender)\r
+       smtp.mail=pieter@praet.org\r
+Received: from mr.google.com ([10.180.74.177])\r
+       by 10.180.74.177 with SMTP id u17mr38299331wiv.13.1329936360490\r
+       (num_hops = 1); Wed, 22 Feb 2012 10:46:00 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.180.74.177 with SMTP id u17mr31665765wiv.13.1329936360395;\r
+       Wed, 22 Feb 2012 10:46:00 -0800 (PST)\r
+Received: from localhost ([109.131.181.26])\r
+       by mx.google.com with ESMTPS id y1sm74830307wiw.6.2012.02.22.10.45.59\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 22 Feb 2012 10:46:00 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH v2 7/7] emacs: `notmuch-show-toggle-visibility-messages' with\r
+       prefix arg filters by tag\r
+Date: Wed, 22 Feb 2012 19:43:34 +0100\r
+Message-Id: <1329936214-30959-7-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <1327469139-1968-1-git-send-email-pieter@praet.org>\r
+References: <1327469139-1968-1-git-send-email-pieter@praet.org>\r
+X-Gm-Message-State:\r
+ ALoCoQkFa7B6XS5SkhftDbvaGgF3Ka4PuK1L4nqzD+nR1rrM3Man/DdsSv8AJfvgfF+x7JMCOTVa\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 22 Feb 2012 18:46:15 -0000\r
+\r
+* emacs/notmuch-show.el (notmuch-show-toggle-visibility-messages):\r
+  When provided with a prefix arg, prompt the user for a tag.\r
+  Show all messages that have it and hide those that don't.\r
+---\r
+ emacs/notmuch-show.el |   13 ++++++++++---\r
+ 1 files changed, 10 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 82d4265..b5e482b 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -38,6 +38,7 @@\r
\r
+ (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))\r
+ (declare-function notmuch-fontify-headers "notmuch" nil)\r
++(declare-function notmuch-select-tag-with-completion "notmuch" (prompt &rest search-terms))\r
+ (declare-function notmuch-read-tag-changes "notmuch" (&optional initial-input &rest search-terms))\r
+ (declare-function notmuch-search-next-thread "notmuch" nil)\r
+ (declare-function notmuch-search-show-thread "notmuch" nil)\r
+@@ -1670,13 +1671,19 @@ (defun notmuch-show-toggle-visibility-message ()\r
\r
+ (defun notmuch-show-toggle-visibility-messages ()\r
+   "Toggle the visibility of all messages in the current thread.\r
+-If the current message is visible, hide all messages -- and vice versa."\r
++If the current message is visible, hide all messages -- and vice versa.\r
++\r
++With a prefix argument, prompt for a tag and only show messages which have it."\r
+   (interactive)\r
+-  (let ((visible-p (notmuch-show-message-visible-p)))\r
++  (let ((visible-p (notmuch-show-message-visible-p))\r
++      (filter (if current-prefix-arg\r
++                  (notmuch-select-tag-with-completion "Filter by tag: "))))\r
+     (notmuch-show-mapc\r
+      (lambda () (notmuch-show-message-visible\r
+                (notmuch-show-get-message-properties)\r
+-               (not visible-p)))))\r
++               (if current-prefix-arg\r
++                   (member filter (notmuch-show-get-tags))\r
++                 (not visible-p))))))\r
\r
+   ;; Put the current message properly into focus, but don't\r
+   ;; obscure the presence of previous messages in the thread.\r
+-- \r
+1.7.8.1\r
+\r