unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: add a filter option to show
Date: Wed, 25 Apr 2012 00:17:01 +0100	[thread overview]
Message-ID: <1335309421-18893-1-git-send-email-markwalters1009@gmail.com> (raw)

Show the current thread with a different filter (i.e., open messages
in the thread matching the new query).

Currently bound to 'F'.

Note that it is not the same as filter in search as it replaces the
existing query rather than ANDing with it (but it does keep the
threadid part of the query).
---

I think filtering (i.e. refining current query) is not ideal as one
might want to remove some aspects of the query. Hence this patch
replaces the query-context. 

Note does not fully work with excludes pending
id:"1331836090-30560-1-git-send-email-markwalters1009@gmail.com"

Best wishes

Mark

 emacs/notmuch-show.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 30b26d1..4a5b8b1 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -42,6 +42,7 @@
 (declare-function notmuch-search-next-thread "notmuch" nil)
 (declare-function notmuch-search-show-thread "notmuch" nil)
 (declare-function notmuch-update-tags "notmuch" (current-tags tag-changes))
+(declare-function notmuch-read-query "notmuch" (prompt))
 
 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
   "Headers that should be shown in a message, in this order.
@@ -1157,6 +1158,7 @@ reset based on the original query."
 	(define-key map "s" 'notmuch-search)
 	(define-key map "m" 'notmuch-mua-new-mail)
 	(define-key map "f" 'notmuch-show-forward-message)
+	(define-key map "F" 'notmuch-show-filter-thread)
 	(define-key map "r" 'notmuch-show-reply-sender)
 	(define-key map "R" 'notmuch-show-reply)
 	(define-key map "|" 'notmuch-show-pipe-message)
@@ -1399,6 +1401,12 @@ current thread."
   "Mark the current message as read."
   (notmuch-show-tag-message "-unread"))
 
+(defun notmuch-show-filter-thread ()
+  "Show the current thread with a different filter"
+  (interactive)
+  (setq notmuch-show-query-context (notmuch-read-query "Filter thread: "))
+  (notmuch-show-refresh-view t))
+
 ;; Functions for getting attributes of several messages in the current
 ;; thread.
 
-- 
1.7.9.1

             reply	other threads:[~2012-04-24 23:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 23:17 Mark Walters [this message]
2012-04-25  2:35 ` [PATCH] emacs: add a filter option to show Jeremy Nickurak
2012-04-25  2:55 ` Austin Clements
2012-04-25  7:54   ` Mark Walters
2012-04-25 12:04   ` David Bremner

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=1335309421-18893-1-git-send-email-markwalters1009@gmail.com \
    --to=markwalters1009@gmail.com \
    --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).