X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch.el;h=8e752198f240cd1e98f8e5c9628a316fdf2877e9;hb=33fae33d82baa31f9b6b5dd774ffda76d4d7fcbc;hp=07f5477986b8cc367c153d619f2450a9c33baf92;hpb=278ae86f64a58bd9265441d858916f6f0a22ed18;p=notmuch diff --git a/notmuch.el b/notmuch.el index 07f54779..8e752198 100644 --- a/notmuch.el +++ b/notmuch.el @@ -95,8 +95,11 @@ (defun notmuch-show-remove-tag (tag) (interactive "sTag to remove: ") - (notmuch-call-notmuch-process "tag" (concat "-" tag) (concat "id:" (notmuch-show-get-message-id))) - (notmuch-show-set-tags (delete tag (notmuch-show-get-tags)))) + (let ((tags (notmuch-show-get-tags))) + (if (member tag tags) + (progn + (notmuch-call-notmuch-process "tag" (concat "-" tag) (concat "id:" (notmuch-show-get-message-id))) + (notmuch-show-set-tags (delete tag tags)))))) (defun notmuch-show-archive-thread () "Archive each message currrently shown by removing the \"inbox\" tag from each. @@ -178,8 +181,7 @@ simply move to the beginning of the current message." (defun notmuch-show-mark-read-then-next-message () "Remove unread tag from current message, then advance to next message." (interactive) - (if (member "unread" (notmuch-show-get-tags)) - (notmuch-show-remove-tag "unread")) + (notmuch-show-remove-tag "unread") (notmuch-show-next-message)) (defun notmuch-show-advance-marking-read-and-archiving ()