unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: Push the cursor to point-max on `n' or `N' at the end of a thread
@ 2010-04-22 11:20 David Edmondson
  2010-04-23 20:27 ` Carl Worth
  0 siblings, 1 reply; 2+ messages in thread
From: David Edmondson @ 2010-04-22 11:20 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] emacs: Push the cursor to point-max on `n' or `N' at the end of a thread
  2010-04-22 11:20 [PATCH] emacs: Push the cursor to point-max on `n' or `N' at the end of a thread David Edmondson
@ 2010-04-23 20:27 ` Carl Worth
  0 siblings, 0 replies; 2+ messages in thread
From: Carl Worth @ 2010-04-23 20:27 UTC (permalink / raw)
  To: David Edmondson, notmuch

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

On Thu, 22 Apr 2010 12:20:16 +0100, David Edmondson <dme@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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-23 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22 11:20 [PATCH] emacs: Push the cursor to point-max on `n' or `N' at the end of a thread David Edmondson
2010-04-23 20:27 ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).