notmuch.el: Don't try to remove an "unread" tag that's not there.
authorCarl Worth <cworth@cworth.org>
Tue, 3 Nov 2009 21:16:40 +0000 (13:16 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 3 Nov 2009 21:38:05 +0000 (13:38 -0800)
This optimization wouldn't be necessary if we had a nice fast "notmuch
tag" command. But since it's currently fairly slow, (see Xapian defect
250: http://trac.xapian.org/ticket/250), we're willing to take some
extra care to avoid calling "notmuch tag" unnecessarily.

notmuch.el

index 89089c53e7c40f032330a28bbc871aa7911376fa..513b7d9163e3b87e484035b97653b2803dae629c 100644 (file)
 
 Before moving, also remove the \"unread\" tag from the current message."
   (interactive)
-  (notmuch-show-remove-tag "unread")
+  (if (member "unread" (notmuch-show-get-tags))
+      (notmuch-show-remove-tag "unread"))
   ; First, ensure we get off the current message marker
   (if (not (eobp))
       (forward-char))