]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch.el: Make 'n' and 'p' bring the current message to the top.
authorCarl Worth <cworth@cworth.org>
Tue, 3 Nov 2009 04:47:11 +0000 (20:47 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 3 Nov 2009 04:47:11 +0000 (20:47 -0800)
This is much more convenient for reading the messages, and happens
to match the behavior of sup.

notmuch.el

index 7fe5e9783cc0fdab735c6ea5f102a5b1068961e3..9c3c1e065c870bf9f9fe24c5139d08183c775861 100644 (file)
@@ -51,7 +51,8 @@
       (forward-char))
   (if (not (re-search-forward notmuch-show-message-begin-regexp nil t))
       (goto-char (point-max)))
-  (beginning-of-line))
+  (beginning-of-line)
+  (recenter 0))
 
 (defun notmuch-show-previous-message ()
   "Advance point to the beginning of the previous message in the buffer."
@@ -60,9 +61,9 @@
   (if (not (eobp))
       (forward-char))
   (if (not (re-search-backward notmuch-show-message-begin-regexp nil t))
-      (progn
-       (goto-char (point-min))
-       (beginning-of-line))))
+      (goto-char (point-min)))
+  (beginning-of-line)
+  (recenter 0))
 
 ;;;###autoload
 (defun notmuch-show-mode ()