mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
emacs: cleanup and simplify `notmuch-show-archive-thread' and related functions
Recent changes in notmuch-show tagging introduced some code duplication. The patch cleanups and simplifies `notmuch-show-archive-thread' function by using `notmuch-show-tag-all', no longer used function are removed. After the change, `notmuch-show-archive-thread' function becomes symmetric with `notmuch-show-archive-message'. A side effect of these changes is that `notmuch-show-archive-thread' no longer calls "notmuch tag" for each message in the thread.
This commit is contained in:
parent
668b66ec85
commit
a5674c2158
1 changed files with 2 additions and 23 deletions
|
@ -1690,26 +1690,6 @@ argument, hide all of the messages."
|
||||||
(interactive)
|
(interactive)
|
||||||
(backward-button 1))
|
(backward-button 1))
|
||||||
|
|
||||||
(defun notmuch-show-tag-thread-internal (tag &optional remove)
|
|
||||||
"Add tag to the current set of messages.
|
|
||||||
|
|
||||||
If the remove switch is given, tags will be removed instead of
|
|
||||||
added."
|
|
||||||
(goto-char (point-min))
|
|
||||||
(let ((op (if remove "-" "+")))
|
|
||||||
(loop do (notmuch-show-tag-message (concat op tag))
|
|
||||||
until (not (notmuch-show-goto-message-next)))))
|
|
||||||
|
|
||||||
(defun notmuch-show-add-tag-thread (tag)
|
|
||||||
"Add tag to all messages in the current thread."
|
|
||||||
(interactive)
|
|
||||||
(notmuch-show-tag-thread-internal tag))
|
|
||||||
|
|
||||||
(defun notmuch-show-remove-tag-thread (tag)
|
|
||||||
"Remove tag from all messages in the current thread."
|
|
||||||
(interactive)
|
|
||||||
(notmuch-show-tag-thread-internal tag t))
|
|
||||||
|
|
||||||
(defun notmuch-show-next-thread (&optional show-next)
|
(defun notmuch-show-next-thread (&optional show-next)
|
||||||
"Move to the next item in the search results, if any."
|
"Move to the next item in the search results, if any."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
|
@ -1737,9 +1717,8 @@ being delivered to the same thread. It does not archive the
|
||||||
entire thread, but only the messages shown in the current
|
entire thread, but only the messages shown in the current
|
||||||
buffer."
|
buffer."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(if unarchive
|
(let ((op (if unarchive "+" "-")))
|
||||||
(notmuch-show-add-tag-thread "inbox")
|
(notmuch-show-tag-all (concat op "inbox"))))
|
||||||
(notmuch-show-remove-tag-thread "inbox")))
|
|
||||||
|
|
||||||
(defun notmuch-show-archive-thread-then-next ()
|
(defun notmuch-show-archive-thread-then-next ()
|
||||||
"Archive each message in thread, then show next thread from search."
|
"Archive each message in thread, then show next thread from search."
|
||||||
|
|
Loading…
Reference in a new issue