]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Make moving to the previous message move to the previous boundary
authorAustin Clements <amdragon@MIT.EDU>
Sat, 14 Jul 2012 03:47:48 +0000 (23:47 -0400)
committerDavid Bremner <bremner@debian.org>
Sun, 12 Aug 2012 19:30:10 +0000 (21:30 +0200)
Previously, notmuch-show-previous-message would move to the beginning
of the message before the message containing point.  This patch makes
it instead move to the previous message *boundary*.  That is, if point
isn't already at the beginning of the message, it moves to the
beginning of the current message.  This is consistent with
notmuch-show-next-message, which can be thought of as moving to the
next message boundary.  Several people have expressed a preference for
this.

emacs/notmuch-show.el

index dcfc1901ca5a56f3b92a059a7cf8c6bbf78968e6..82b5399c499fac18e444e45a279756288717e004 100644 (file)
@@ -1525,9 +1525,11 @@ thread, navigate to the next thread in the parent search buffer."
       (goto-char (point-max)))))
 
 (defun notmuch-show-previous-message ()
-  "Show the previous message."
+  "Show the previous message or the start of the current message."
   (interactive)
-  (notmuch-show-goto-message-previous)
+  (if (= (point) (notmuch-show-message-top))
+      (notmuch-show-goto-message-previous)
+    (notmuch-show-move-to-message-top))
   (notmuch-show-mark-read)
   (notmuch-show-message-adjust))
 
@@ -1587,7 +1589,9 @@ to show, nil otherwise."
 (defun notmuch-show-previous-open-message ()
   "Show the previous open message."
   (interactive)
-  (while (and (notmuch-show-goto-message-previous)
+  (while (and (if (= (point) (notmuch-show-message-top))
+                 (notmuch-show-goto-message-previous)
+               (notmuch-show-move-to-message-top))
              (not (notmuch-show-message-visible-p))))
   (notmuch-show-mark-read)
   (notmuch-show-message-adjust))