aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-show.el
diff options
context:
space:
mode:
authorGravatar Jameson Graef Rollins <jrollins@finestructure.net>2012-01-24 16:06:20 -0800
committerGravatar David Bremner <bremner@debian.org>2012-01-30 23:23:49 -0400
commitcdb51decddc4b013a47e7164891c5bc9041f6fc3 (patch)
treedba52263a31625500d75788432f9504cd26b61ed /emacs/notmuch-show.el
parent436c98a9732ea66a134674d7ff4711b7cdd8bbf9 (diff)
emacs: add option to show-next-{, open-}message functions to pop out to parent buffer if at end
This will allow for keybindings that achieve a smoother message processing flow by reducing the number of key presses needed for most common operations.
Diffstat (limited to 'emacs/notmuch-show.el')
-rw-r--r--emacs/notmuch-show.el27
1 files changed, 19 insertions, 8 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 28713504..293c00b6 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1390,14 +1390,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 +1411,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,7 +1425,9 @@ 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."