aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-03 17:01:07 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-03 17:01:07 -0800
commitc4ea149a9bc3a0a49d58e956cf35a96210f4ad1e (patch)
treea6a62023867e70986f081e7985da5466e1cb0575 /notmuch.el
parent50f260a1a3a626eccd5d22e30795f18ac994a608 (diff)
notmuch.el: Add 't' binding to filter results to a specific tag.
This is a convenience function to avoid having to type "tag:" with the (f)ilter command.
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el16
1 files changed, 12 insertions, 4 deletions
diff --git a/notmuch.el b/notmuch.el
index 18aca1c7..989450a6 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -328,6 +328,7 @@ Does nothing if already on the first message in the buffer."
(define-key map "p" 'previous-line)
(define-key map "q" 'kill-this-buffer)
(define-key map "s" 'notmuch-search)
+ (define-key map "t" 'notmuch-search-filter-by-tag)
(define-key map "x" 'kill-this-buffer)
(define-key map "\r" 'notmuch-search-show-thread)
(define-key map "+" 'notmuch-search-add-tag)
@@ -492,14 +493,21 @@ same relative position within the new buffer."
(goto-char here))))
(defun notmuch-search-filter (query)
- "Run \"notmuch search\" to refine the current search results.
+ "Filter the current search results based on an additional query string.
-A search string will be constructed by appending QUERY to the
-current search string, and the results of \"notmuch search\" for
-the combined query will be displayed."
+Runs a new search matching only messages that match both the
+current search results AND the additional query string provided."
(interactive "sFilter search: ")
(notmuch-search (concat notmuch-search-query-string " and " query)))
+(defun notmuch-search-filter-by-tag (tag)
+ "Filter the current search results based on a single tag.
+
+Runs a new search matching only messages that match both the
+current search results AND that are tagged with the given tag."
+ (interactive "sFilter by tag: ")
+ (notmuch-search (concat notmuch-search-query-string " and tag:" tag)))
+
(defun notmuch ()
"Run notmuch to display all mail with tag of 'inbox'"
(interactive)