]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch-search-add/remove-tag: restrict to messages in current query
authorJed Brown <jed@59A2.org>
Thu, 26 Nov 2009 21:36:50 +0000 (22:36 +0100)
committerCarl Worth <cworth@cworth.org>
Fri, 27 Nov 2009 13:57:07 +0000 (05:57 -0800)
Rather than tagging the everything in the thread.  This is arguably more
desirable behavior and is consistent with clearly desirably behavior of
notmuch-search-operate-all.

Note that this change applies indirectly to
notmuch-search-archive-thread (which is actually equivalent behavior
since this function is primarily used when browsing an inbox).

Signed-off-by: Jed Brown <jed@59A2.org>
notmuch.el

index 6adac9e663e7d9cf79325ae506dd991e21269194..e9786c0b28885c86e2a62b24f06296bc19ac380e 100644 (file)
@@ -935,15 +935,19 @@ and will also appear in a buffer named \"*Notmuch errors*\"."
        (split-string (buffer-substring beg end))))))
 
 (defun notmuch-search-add-tag (tag)
+  "Add a tag to messages in the current thread matching the
+active query."
   (interactive
    (list (notmuch-select-tag-with-completion "Tag to add: ")))
-  (notmuch-call-notmuch-process "tag" (concat "+" tag) (notmuch-search-find-thread-id))
+  (notmuch-call-notmuch-process "tag" (concat "+" tag) (notmuch-search-find-thread-id) " and " notmuch-search-query-string)
   (notmuch-search-set-tags (delete-dups (sort (cons tag (notmuch-search-get-tags)) 'string<))))
 
 (defun notmuch-search-remove-tag (tag)
+  "Remove a tag from messages in the current thread matching the
+active query."
   (interactive
    (list (notmuch-select-tag-with-completion "Tag to remove: " (notmuch-search-find-thread-id))))
-  (notmuch-call-notmuch-process "tag" (concat "-" tag) (notmuch-search-find-thread-id))
+  (notmuch-call-notmuch-process "tag" (concat "-" tag) (notmuch-search-find-thread-id) " and " notmuch-search-query-string)
   (notmuch-search-set-tags (delete tag (notmuch-search-get-tags))))
 
 (defun notmuch-search-archive-thread ()