unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: add a filter option to show
@ 2012-04-24 23:17 Mark Walters
  2012-04-25  2:35 ` Jeremy Nickurak
  2012-04-25  2:55 ` Austin Clements
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Walters @ 2012-04-24 23:17 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-25 12:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24 23:17 [PATCH] emacs: add a filter option to show Mark Walters
2012-04-25  2:35 ` Jeremy Nickurak
2012-04-25  2:55 ` Austin Clements
2012-04-25  7:54   ` Mark Walters
2012-04-25 12:04   ` David Bremner

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).