summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmondson <dme@dme.org>2010-04-22 12:20:16 +0100
committerCarl Worth <cworth@cworth.org>2010-04-23 13:26:32 -0700
commit7135a8bcbf0cf17931af3f017bce81bb557ea1eb (patch)
tree8a0c00271e5c424801f97fc167d8a7e1d42da39b
parent57926bc7b0f784cbacb620fda0ee5157e2e0ff27 (diff)
emacs: Push the cursor to point-max on `n' or `N' at the end of a thread
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.
-rw-r--r--emacs/notmuch-show.el28
1 files changed, 17 insertions, 11 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 12e5d28..53af301 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -30,9 +30,9 @@
(require 'notmuch-lib)
(require 'notmuch-query)
(require 'notmuch-wash)
+(require 'notmuch-mua)
(declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
-(declare-function notmuch-reply "notmuch" (query-string))
(declare-function notmuch-fontify-headers "notmuch" nil)
(declare-function notmuch-select-tag-with-completion "notmuch" (prompt &rest search-terms))
(declare-function notmuch-search-show-thread "notmuch" nil)
@@ -507,7 +507,7 @@ function is used. "
(define-key map (kbd "M-TAB") 'notmuch-show-previous-button)
(define-key map (kbd "TAB") 'notmuch-show-next-button)
(define-key map "s" 'notmuch-search)
- (define-key map "m" 'message-mail)
+ (define-key map "m" 'notmuch-mua-mail)
(define-key map "f" 'notmuch-show-forward-message)
(define-key map "r" 'notmuch-show-reply)
(define-key map "|" 'notmuch-show-pipe-message)
@@ -804,20 +804,22 @@ any effects from previous calls to
(defun notmuch-show-reply ()
"Reply to the current message."
(interactive)
- (notmuch-reply (notmuch-show-get-message-id)))
+ (notmuch-mua-reply (notmuch-show-get-message-id)))
(defun notmuch-show-forward-message ()
"Forward the current message."
(interactive)
(with-current-notmuch-show-message
- (message-forward)))
+ (notmuch-mua-forward-message)))
(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."
@@ -829,10 +831,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."