X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch.el;h=a8a85ce7839d11a9e5fce04d85da57481a51f45e;hb=b7f7b573e4bf3d00d9e887bc1aee264722d22778;hp=1c43d3ee19358fd9e891c53c9c60d3c6e818af4e;hpb=c62126238b2ce6194b3c6511553951497aedf295;p=notmuch diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 1c43d3ee..a8a85ce7 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -593,12 +593,20 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." (interactive) (notmuch-search-tag "-")) -(defun notmuch-search-archive-thread () - "Archive the currently selected thread (remove its \"inbox\" tag). +(defun notmuch-search-archive-thread (&optional unarchive) + "Archive the currently selected thread. + +Archive each message in the currently selected thread by applying +the tag changes in `notmuch-archive-tags' to each (remove the +\"inbox\" tag by default). If a prefix argument is given, the +messages will be \"unarchived\" (i.e. the tag changes in +`notmuch-archive-tags' will be reversed). This function advances the next thread when finished." - (interactive) - (notmuch-search-tag '("-inbox")) + (interactive "P") + (when notmuch-archive-tags + (notmuch-search-tag + (notmuch-tag-change-list notmuch-archive-tags unarchive))) (notmuch-search-next-thread)) (defun notmuch-search-update-result (result &optional pos)