aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-04 11:19:50 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-04 11:19:50 -0800
commit88810b999a478b6af796eb98b0cf35020ee50901 (patch)
treea8887006b650868a3d565c63c6534dfaced9a686 /notmuch.el
parent08d84ceeabce09d9fa870f64907acb8e576ebdef (diff)
notmuch.el: Move to first unread message on notmuch-show.
This is important for when a new message is delivered to an existing enormous thread.
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/notmuch.el b/notmuch.el
index 849654b7..9bf272be 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -172,6 +172,15 @@ message in the buffer."
(notmuch-show-next-message)
(point))))
+(defun notmuch-show-next-unread-message ()
+ "Advance to the beginning of the next unread message in the buffer.
+
+Does nothing if there are no more unread messages past the
+current point."
+ (while (and (not (eobp))
+ (not (member "unread" (notmuch-show-get-tags))))
+ (notmuch-show-next-message)))
+
(defun notmuch-show-previous-message ()
"Backup to the beginning of the previous message in the buffer.
@@ -400,6 +409,7 @@ thread from that buffer can be show when done with this one)."
(call-process "notmuch" nil t nil "show" thread-id)
(notmuch-show-markup-messages)
)
+ (notmuch-show-next-unread-message)
)))
(defvar notmuch-search-mode-map