- (while (and (notmuch-show-goto-message-next)
- (not (notmuch-show-message-visible-p))))
- (notmuch-show-mark-read)
- (notmuch-show-message-adjust))
+ (let (r)
+ (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)))))