X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=de9421e80879edb544a949d801719b412bb10c92;hp=10b3ea91d266e6f74fccf86b398020fb33e15b55;hb=7cd907b69c3134b00f8766571b17b669bd8a80c2;hpb=be05158b69d45b63999707f60b8ee0166438a944 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 10b3ea91..de9421e8 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1076,7 +1076,8 @@ thread id. If a prefix is given, crypto processing is toggled." (define-key map "-" 'notmuch-show-remove-tag) (define-key map "+" 'notmuch-show-add-tag) (define-key map "x" 'notmuch-show-archive-thread-then-exit) - (define-key map "a" 'notmuch-show-archive-thread-then-next) + (define-key map "a" 'notmuch-show-archive-message-then-next) + (define-key map "A" 'notmuch-show-archive-thread-then-next) (define-key map "N" 'notmuch-show-next-message) (define-key map "P" 'notmuch-show-previous-message) (define-key map "n" 'notmuch-show-next-open-message) @@ -1390,14 +1391,19 @@ any effects from previous calls to (with-current-notmuch-show-message (notmuch-mua-new-forward-message prompt-for-sender))) -(defun notmuch-show-next-message () - "Show the next message." - (interactive) +(defun notmuch-show-next-message (&optional pop-at-end) + "Show the next message. + +If a prefix argument is given and this is the last message in the +thread, navigate to the next thread in the parent search buffer." + (interactive "P") (if (notmuch-show-goto-message-next) (progn (notmuch-show-mark-read) (notmuch-show-message-adjust)) - (goto-char (point-max)))) + (if pop-at-end + (notmuch-show-next-thread) + (goto-char (point-max))))) (defun notmuch-show-previous-message () "Show the previous message." @@ -1406,9 +1412,13 @@ any effects from previous calls to (notmuch-show-mark-read) (notmuch-show-message-adjust)) -(defun notmuch-show-next-open-message () - "Show the next message." - (interactive) +(defun notmuch-show-next-open-message (&optional pop-at-end) + "Show the next open message. + +If a prefix argument is given and this is the last open message +in the thread, navigate to the next thread in the parent search +buffer." + (interactive "P") (let (r) (while (and (setq r (notmuch-show-goto-message-next)) (not (notmuch-show-message-visible-p)))) @@ -1416,10 +1426,12 @@ any effects from previous calls to (progn (notmuch-show-mark-read) (notmuch-show-message-adjust)) - (goto-char (point-max))))) + (if pop-at-end + (notmuch-show-next-thread) + (goto-char (point-max)))))) (defun notmuch-show-previous-open-message () - "Show the previous message." + "Show the previous open message." (interactive) (while (and (notmuch-show-goto-message-previous) (not (notmuch-show-message-visible-p)))) @@ -1622,6 +1634,23 @@ buffer." (notmuch-show-archive-thread) (notmuch-show-next-thread)) +(defun notmuch-show-archive-message (&optional unarchive) + "Archive the current message. + +If a prefix argument is given, the message will be +\"unarchived\" (ie. the \"inbox\" tag will be added instead of +removed)." + (interactive "P") + (if unarchive + (notmuch-show-add-tag "inbox") + (notmuch-show-remove-tag "inbox"))) + +(defun notmuch-show-archive-message-then-next () + "Archive the current message, then show the next open message in the current thread." + (interactive) + (notmuch-show-archive-message) + (notmuch-show-next-open-message t)) + (defun notmuch-show-stash-cc () "Copy CC field of current message to kill-ring." (interactive)