aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-04 11:03:07 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-04 11:03:07 -0800
commit08d84ceeabce09d9fa870f64907acb8e576ebdef (patch)
tree6972d77bd115f7d0126687d3c892b6f3434ee78f /notmuch.el
parentc5672ca12a1694a64376141f1ac9f65312d7ccb0 (diff)
notmuch.el: Make next-message move to end of buffer after last message.
We need an easier way to detect when we're done with the last message so taking advantage of the end-of-buffer position helps here.
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/notmuch.el b/notmuch.el
index 16ca037e..849654b7 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -150,12 +150,13 @@ by searching backward)."
(defun notmuch-show-next-message ()
"Advance to the beginning of the next message in the buffer.
-Moves to the beginning of the current message if already on the
-last message in the buffer."
+Moves to the end of the buffer if already on the last message in
+the buffer."
(interactive)
(notmuch-show-move-to-current-message-summary-line)
- (re-search-forward notmuch-show-message-begin-regexp nil t)
- (notmuch-show-move-to-current-message-summary-line)
+ (if (re-search-forward notmuch-show-message-begin-regexp nil t)
+ (notmuch-show-move-to-current-message-summary-line)
+ (goto-char (point-max)))
(recenter 0))
(defun notmuch-show-find-next-message ()
@@ -218,9 +219,10 @@ which this thread was originally shown."
(if (and (not unread)
(equal next (point)))
(notmuch-show-archive-thread)
- (if (< (notmuch-show-find-next-message) (window-end))
- (notmuch-show-mark-read-then-next-message)
- (scroll-up nil)))))
+ (if (and (> next (window-end))
+ (< next (point-max)))
+ (scroll-up nil)
+ (notmuch-show-mark-read-then-next-message)))))
(defun notmuch-show-markup-citations-region (beg end)
(goto-char beg)