]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
emacs: introduce notmuch-search-by-tag
[notmuch] / emacs / notmuch.el
index f4789b4f4cdb65b4f485ed0d6b764754336259e7..f5f0324485f63296ad43403eb8ede17bbda952e8 100644 (file)
@@ -1077,6 +1077,12 @@ current search results AND that are tagged with the given tag."
    (list (notmuch-select-tag-with-completion "Filter by tag: " notmuch-search-query-string)))
   (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first))
 
+(defun notmuch-search-by-tag (tag)
+  "Display threads matching TAG in a notmuch-search buffer."
+  (interactive
+   (list (notmuch-select-tag-with-completion "Notmuch search tag: ")))
+  (notmuch-search (concat "tag:" tag)))
+
 ;;;###autoload
 (defun notmuch ()
   "Run notmuch and display saved searches, known tags, etc."