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.
This commit is contained in:
Carl Worth 2009-11-04 11:03:07 -08:00
parent c5672ca12a
commit 08d84ceeab

View file

@ -150,12 +150,13 @@ by searching backward)."
(defun notmuch-show-next-message () (defun notmuch-show-next-message ()
"Advance to the beginning of the next message in the buffer. "Advance to the beginning of the next message in the buffer.
Moves to the beginning of the current message if already on the Moves to the end of the buffer if already on the last message in
last message in the buffer." the buffer."
(interactive) (interactive)
(notmuch-show-move-to-current-message-summary-line) (notmuch-show-move-to-current-message-summary-line)
(re-search-forward notmuch-show-message-begin-regexp nil t) (if (re-search-forward notmuch-show-message-begin-regexp nil t)
(notmuch-show-move-to-current-message-summary-line) (notmuch-show-move-to-current-message-summary-line)
(goto-char (point-max)))
(recenter 0)) (recenter 0))
(defun notmuch-show-find-next-message () (defun notmuch-show-find-next-message ()
@ -218,9 +219,10 @@ which this thread was originally shown."
(if (and (not unread) (if (and (not unread)
(equal next (point))) (equal next (point)))
(notmuch-show-archive-thread) (notmuch-show-archive-thread)
(if (< (notmuch-show-find-next-message) (window-end)) (if (and (> next (window-end))
(notmuch-show-mark-read-then-next-message) (< next (point-max)))
(scroll-up nil))))) (scroll-up nil)
(notmuch-show-mark-read-then-next-message)))))
(defun notmuch-show-markup-citations-region (beg end) (defun notmuch-show-markup-citations-region (beg end)
(goto-char beg) (goto-char beg)