[PATCH 7/7] emacs: Fix navigation of multi-line search result formats
Austin Clements
amdragon at MIT.EDU
Thu Jul 12 17:45:19 PDT 2012
At this point, the only remaining functions that don't support
multi-line search result formats are the thread navigation functions.
This patch fixes that by rewriting them in terms of
notmuch-search-result-{beginning,end}.
---
emacs/notmuch.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index f32cfb0..2ece97d 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -287,18 +287,24 @@ For a mouse binding, return nil."
(defun notmuch-search-next-thread ()
"Select the next thread in the search results."
(interactive)
- (forward-line 1))
+ (when (notmuch-search-get-result (notmuch-search-result-end))
+ (goto-char (notmuch-search-result-end))))
(defun notmuch-search-previous-thread ()
"Select the previous thread in the search results."
(interactive)
- (forward-line -1))
+ (if (notmuch-search-get-result)
+ (unless (bobp)
+ (goto-char (notmuch-search-result-beginning (- (point) 1))))
+ ;; We must be past the end; jump to the last result
+ (notmuch-search-last-thread)))
(defun notmuch-search-last-thread ()
"Select the last thread in the search results."
(interactive)
(goto-char (point-max))
- (forward-line -2))
+ (forward-line -2)
+ (goto-char (notmuch-search-result-beginning)))
(defun notmuch-search-first-thread ()
"Select the first thread in the search results."
--
1.7.10
More information about the notmuch
mailing list