diff options
author | Carl Worth <cworth@cworth.org> | 2009-11-04 11:30:15 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-11-04 11:30:15 -0800 |
commit | 9fc6f4e60d6c2bd98d6bd918af9982131c7fb0b1 (patch) | |
tree | 8eb6d6a46f8691566492be2dbd4ba56ff59e396f | |
parent | 46f41d80b023a2ebc03c678ad0e0feb5ac15b45a (diff) |
notmuch.el: Fix to show *something* when all messages are already read.
With the recent change of showing the first unread message, we would
scroll down to the end of the buffer if all messages were already
read. This would confusingly show nothing visible in the window.
Instead, detect this case and move to the beginning of the buffer.
-rw-r--r-- | notmuch.el | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -175,8 +175,8 @@ the buffer." (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." +Moves to the end of the buffer 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))) @@ -184,7 +184,7 @@ current point." (defun notmuch-show-find-next-unread-message () "Returns the position of the next message in the buffer. -Returns the current point if there are no more unread messages +Or the end of the buffer if there are no more unread messages past the current point." ; save-excursion doesn't save our window position ; save-window-excursion doesn't save point @@ -423,6 +423,8 @@ thread from that buffer can be show when done with this one)." (notmuch-show-markup-messages) ) (notmuch-show-next-unread-message) + (if (eobp) + (goto-char (point-min))) ))) (defvar notmuch-search-mode-map |