]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch.el
emacs: Fix '+' and '-' in case of thread no longer matching current search.
[notmuch] / notmuch.el
index d180fa4e51ba04f7ed7d9ba4df2a81e0a021f125..fb112f97665c82b81dfe320d1a384270f60261f1 100644 (file)
@@ -950,7 +950,9 @@ matching this search term are shown if non-nil. "
       (save-excursion
        (let* ((basic-args (list notmuch-command nil t nil "show" "--entire-thread" thread-id))
                (args (if query-context (append basic-args (list "and (" query-context ")")) basic-args)))
-         (apply 'call-process args))
+         (apply 'call-process args)
+         (when (and (eq (buffer-size) 0) query-context)
+           (apply 'call-process basic-args)))
        (notmuch-show-markup-messages)
        )
       (run-hooks 'notmuch-show-hook)
@@ -1182,7 +1184,7 @@ The tag is added to messages in the currently selected thread
 which match the current search terms."
   (interactive
    (list (notmuch-select-tag-with-completion "Tag to add: ")))
-  (notmuch-call-notmuch-process "tag" (concat "+" tag) (notmuch-search-find-thread-id) " and " notmuch-search-query-string)
+  (notmuch-call-notmuch-process "tag" (concat "+" tag) (notmuch-search-find-thread-id))
   (notmuch-search-set-tags (delete-dups (sort (cons tag (notmuch-search-get-tags)) 'string<))))
 
 (defun notmuch-search-remove-tag (tag)
@@ -1192,7 +1194,7 @@ The tag is removed from messages in the currently selected thread
 which match the current search terms."
   (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) " and " notmuch-search-query-string)
+  (notmuch-call-notmuch-process "tag" (concat "-" tag) (notmuch-search-find-thread-id))
   (notmuch-search-set-tags (delete tag (notmuch-search-get-tags))))
 
 (defun notmuch-search-archive-thread ()