From: Pieter Praet <pieter@praet.org>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH v2 7/7] emacs: `notmuch-show-toggle-visibility-messages' with prefix arg filters by tag
Date: Wed, 22 Feb 2012 19:43:34 +0100 [thread overview]
Message-ID: <1329936214-30959-7-git-send-email-pieter@praet.org> (raw)
In-Reply-To: <1327469139-1968-1-git-send-email-pieter@praet.org>
* emacs/notmuch-show.el (notmuch-show-toggle-visibility-messages):
When provided with a prefix arg, prompt the user for a tag.
Show all messages that have it and hide those that don't.
---
emacs/notmuch-show.el | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 82d4265..b5e482b 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -38,6 +38,7 @@
(declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
(declare-function notmuch-fontify-headers "notmuch" nil)
+(declare-function notmuch-select-tag-with-completion "notmuch" (prompt &rest search-terms))
(declare-function notmuch-read-tag-changes "notmuch" (&optional initial-input &rest search-terms))
(declare-function notmuch-search-next-thread "notmuch" nil)
(declare-function notmuch-search-show-thread "notmuch" nil)
@@ -1670,13 +1671,19 @@ (defun notmuch-show-toggle-visibility-message ()
(defun notmuch-show-toggle-visibility-messages ()
"Toggle the visibility of all messages in the current thread.
-If the current message is visible, hide all messages -- and vice versa."
+If the current message is visible, hide all messages -- and vice versa.
+
+With a prefix argument, prompt for a tag and only show messages which have it."
(interactive)
- (let ((visible-p (notmuch-show-message-visible-p)))
+ (let ((visible-p (notmuch-show-message-visible-p))
+ (filter (if current-prefix-arg
+ (notmuch-select-tag-with-completion "Filter by tag: "))))
(notmuch-show-mapc
(lambda () (notmuch-show-message-visible
(notmuch-show-get-message-properties)
- (not visible-p)))))
+ (if current-prefix-arg
+ (member filter (notmuch-show-get-tags))
+ (not visible-p))))))
;; Put the current message properly into focus, but don't
;; obscure the presence of previous messages in the thread.
--
1.7.8.1
prev parent reply other threads:[~2012-02-22 18:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-25 5:25 [PATCH] emacs: make `notmuch-show-open-or-close-all' toggle visibility Pieter Praet
2012-01-25 6:35 ` David Edmondson
2012-01-25 13:03 ` Tomi Ollila
2012-01-26 13:02 ` Pieter Praet
2012-01-26 15:04 ` David Edmondson
2012-01-26 15:58 ` Tomi Ollila
2012-02-13 10:51 ` Dmitry Kurochkin
2012-02-22 18:41 ` Pieter Praet
2012-02-22 18:43 ` [PATCH v2 1/7] test: emacs: new tests "notmuch-show: {show, hide} message headers" Pieter Praet
2012-10-20 20:40 ` David Bremner
2012-02-22 18:43 ` [PATCH v2 2/7] test: emacs: new tests "notmuch-show: {, un}collapse all messages in thread" Pieter Praet
2012-02-22 18:43 ` [PATCH v2 3/7] emacs: rename `notmuch-show-toggle-headers' to `notmuch-show-toggle-visibility-headers' Pieter Praet
2012-10-12 21:36 ` Ethan Glasser-Camp
2012-10-18 0:29 ` Ethan Glasser-Camp
2012-10-18 9:47 ` Tomi Ollila
2012-10-18 9:50 ` Tomi Ollila
2012-10-18 13:37 ` Ethan
2012-10-18 13:59 ` Tomi Ollila
2012-02-22 18:43 ` [PATCH v2 4/7] emacs: rename `notmuch-show-toggle-message' to `notmuch-show-toggle-visibility-message' Pieter Praet
2012-02-22 18:43 ` [PATCH v2 5/7] emacs: rename `notmuch-show-open-or-close-all' to `notmuch-show-toggle-visibility-messages' Pieter Praet
2012-02-22 18:43 ` [PATCH v2 6/7] emacs: make `notmuch-show-toggle-visibility-messages' live up to its new name Pieter Praet
2012-02-22 18:43 ` Pieter Praet [this message]
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329936214-30959-7-git-send-email-pieter@praet.org \
--to=pieter@praet.org \
--cc=notmuch@notmuchmail.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 public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).