(defun notmuch-search-add-tag-region (tag beg end)
(let ((search-id-string (mapconcat 'identity (notmuch-search-find-thread-id-region beg end) " or ")))
(notmuch-call-notmuch-process "tag" (concat "+" tag) search-id-string)
(save-excursion
(defun notmuch-search-add-tag-region (tag beg end)
(let ((search-id-string (mapconcat 'identity (notmuch-search-find-thread-id-region beg end) " or ")))
(notmuch-call-notmuch-process "tag" (concat "+" tag) search-id-string)
(save-excursion
(notmuch-search-set-tags (delete-dups (sort (cons tag (notmuch-search-get-tags)) 'string<)))
(forward-line))))))
(defun notmuch-search-remove-tag-thread (tag)
(notmuch-search-set-tags (delete-dups (sort (cons tag (notmuch-search-get-tags)) 'string<)))
(forward-line))))))
(defun notmuch-search-remove-tag-thread (tag)
(defun notmuch-search-remove-tag-region (tag beg end)
(let ((search-id-string (mapconcat 'identity (notmuch-search-find-thread-id-region beg end) " or ")))
(notmuch-call-notmuch-process "tag" (concat "-" tag) search-id-string)
(save-excursion
(defun notmuch-search-remove-tag-region (tag beg end)
(let ((search-id-string (mapconcat 'identity (notmuch-search-find-thread-id-region beg end) " or ")))
(notmuch-call-notmuch-process "tag" (concat "-" tag) search-id-string)
(save-excursion
-The tag is added to messages in the currently selected thread or
-region which match the current search terms."
+The tag is added to all messages in the currently selected thread
+or threads in the current region."
-The tag is removed from all messages in the currently selected thread
-or region which match the current search terms."
+The tag is removed from all messages in the currently selected
+thread or threads in the current region."