mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
notmuch.el: Make archive-thread more efficient for already archived messages.
The approach here is to move the optimization from mark-read to the more general remove-tag. Namely, don't call out to a "notmuch tag" command to remove a tag that's not there already.
This commit is contained in:
parent
278ae86f64
commit
33fae33d82
1 changed files with 6 additions and 4 deletions
10
notmuch.el
10
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 ()
|
||||
|
|
Loading…
Reference in a new issue