[PATCH 4/6] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end

Jameson Graef Rollins jrollins at finestructure.net
Tue Jan 17 10:05:29 PST 2012


This will allow for keybindings that achieve a smoother message
processing flow by reducing the number of key presses needed for most
common operations.
---
 emacs/notmuch-show.el |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 207949c..6b2e6e9 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1270,17 +1270,23 @@ any effects from previous calls to
   (notmuch-show-mark-read)
   (notmuch-show-message-adjust))
 
-(defun notmuch-show-next-open-message ()
+(defun notmuch-show-next-open-message (&optional pop-at-end)
   "Show the next message."
   (interactive)
-  (let (r)
+  (let ((r)
+	(parent-buffer notmuch-show-parent-buffer))
     (while (and (setq r (notmuch-show-goto-message-next))
 		(not (notmuch-show-message-visible-p))))
     (if r
 	(progn
 	  (notmuch-show-mark-read)
 	  (notmuch-show-message-adjust))
-      (goto-char (point-max)))))
+      (if (and parent-buffer pop-at-end)
+	  (progn
+	    (kill-this-buffer)
+	    (switch-to-buffer parent-buffer)
+	    (forward-line 1))
+	(goto-char (point-max))))))
 
 (defun notmuch-show-previous-open-message ()
   "Show the previous message."
-- 
1.7.7.3



More information about the notmuch mailing list