[PATCH] emacs: Push the cursor to point-max on `n' or `N' at the end of a thread

2010-04-23 Thread Carl Worth
On Thu, 22 Apr 2010 12:20:16 +0100, David Edmondson  wrote:
> Sebastian pointed out that the pre-JSON UI would move the cursor to
> the end of the buffer if `n' or `N' is hit when on the last (unread)
> message. Mimic that behaviour in the new UI.

Quite a lovely improvement. Thanks! This is pushed.

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



Re: [PATCH] emacs: Push the cursor to point-max on `n' or `N' at the end of a thread

2010-04-23 Thread Carl Worth
On Thu, 22 Apr 2010 12:20:16 +0100, David Edmondson d...@dme.org wrote:
 Sebastian pointed out that the pre-JSON UI would move the cursor to
 the end of the buffer if `n' or `N' is hit when on the last (unread)
 message. Mimic that behaviour in the new UI.

Quite a lovely improvement. Thanks! This is pushed.

-Carl


pgpKFriuRHasG.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: Push the cursor to point-max on `n' or `N' at the end of a thread

2010-04-22 Thread David Edmondson
Sebastian pointed out that the pre-JSON UI would move the cursor to
the end of the buffer if `n' or `N' is hit when on the last (unread)
message. Mimic that behaviour in the new UI.
---
 emacs/notmuch-show.el |   20 +---
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 379e344..d01bf36 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -816,9 +816,11 @@ any effects from previous calls to
 (defun notmuch-show-next-message ()
   "Show the next message."
   (interactive)
-  (notmuch-show-goto-message-next)
-  (notmuch-show-mark-read)
-  (notmuch-show-message-adjust))
+  (if (notmuch-show-goto-message-next)
+  (progn
+   (notmuch-show-mark-read)
+   (notmuch-show-message-adjust))
+(goto-char (point-max

 (defun notmuch-show-previous-message ()
   "Show the previous message."
@@ -830,10 +832,14 @@ any effects from previous calls to
 (defun notmuch-show-next-open-message ()
   "Show the next message."
   (interactive)
-  (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)

 (defun notmuch-show-previous-open-message ()
   "Show the previous message."
-- 
1.7.0