X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=3a1a8c89e0b76cdfaff40eb31b28fb77cb015dcf;hp=2871350459dc2e7b349f86e8c8b15473034b5a92;hb=6bd3d8af5431542f352f084b6366e88b98b019a1;hpb=436c98a9732ea66a134674d7ff4711b7cdd8bbf9 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 28713504..3a1a8c89 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1018,7 +1018,7 @@ buffer." (notmuch-show-next-open-message)) ;; Set the header line to the subject of the first open message. - (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject))) + (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject))) (notmuch-show-mark-read))) @@ -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) @@ -1249,6 +1250,9 @@ Some useful entries are: (defun notmuch-show-get-depth () (notmuch-show-get-prop :depth)) +(defun notmuch-show-get-pretty-subject () + (notmuch-prettify-subject (notmuch-show-get-subject))) + (defun notmuch-show-set-tags (tags) "Set the tags of the current message." (notmuch-show-set-prop :tags tags) @@ -1363,11 +1367,10 @@ any effects from previous calls to ;; If a small number of lines from the previous message are ;; visible, realign so that the top of the current message is at ;; the top of the screen. - (if (<= (count-screen-lines (window-start) start-of-message) - next-screen-context-lines) - (progn - (goto-char (notmuch-show-message-top)) - (notmuch-show-message-adjust))) + (when (<= (count-screen-lines (window-start) start-of-message) + next-screen-context-lines) + (goto-char (notmuch-show-message-top)) + (notmuch-show-message-adjust)) ;; Move to the top left of the window. (goto-char (window-start))) (t @@ -1390,14 +1393,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 +1414,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 +1428,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)))) @@ -1637,7 +1651,7 @@ removed)." "Archive the current message, then show the next open message in the current thread." (interactive) (notmuch-show-archive-message) - (notmuch-show-next-open-message)) + (notmuch-show-next-open-message t)) (defun notmuch-show-stash-cc () "Copy CC field of current message to kill-ring."