aboutsummaryrefslogtreecommitdiffhomepage
path: root/contrib
diff options
context:
space:
mode:
authorGravatar Mark Walters <markwalters1009@gmail.com>2013-08-25 20:55:34 +0100
committerGravatar David Bremner <bremner@debian.org>2013-09-03 06:12:36 -0300
commit9d2ac59a80ce6ed717d3708983a00255f39626de (patch)
tree31873c2f17507b33d00383e5b0c0ae72e7d1b9d8 /contrib
parent3edd9f127bb201ea746e79ac95ae06ee07cb76e5 (diff)
contrib: pick: bind M-p and M-n to prev/next thread
This adds functions to go to the previous or next thread to pick. Prev-thread behaves similarly to prev-message in show: if you are on the top line of a thread it will go to the top of the previous thread, otherwise it will go to the top of the current thread. Next thread will always go to the top of the next thread (or the end of buffer). These are bound to "M-p" and "M-n" by default (matching the bindings in show).
Diffstat (limited to 'contrib')
-rw-r--r--contrib/notmuch-pick/notmuch-pick.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index d0160144..f7caaa82 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -250,6 +250,8 @@ FUNC."
(define-key map "p" 'notmuch-pick-prev-matching-message)
(define-key map "N" 'notmuch-pick-next-message)
(define-key map "P" 'notmuch-pick-prev-message)
+ (define-key map (kbd "M-p") 'notmuch-pick-prev-thread)
+ (define-key map (kbd "M-n") 'notmuch-pick-next-thread)
(define-key map "-" 'notmuch-pick-remove-tag)
(define-key map "+" 'notmuch-pick-add-tag)
(define-key map "*" 'notmuch-pick-tag-thread)
@@ -601,6 +603,17 @@ message will be \"unarchived\", i.e. the tag changes in
(while (not (or (notmuch-pick-get-prop :first) (eobp)))
(forward-line -1))))
+(defun notmuch-pick-prev-thread ()
+ (interactive)
+ (forward-line -1)
+ (notmuch-pick-thread-top))
+
+(defun notmuch-pick-next-thread ()
+ (interactive)
+ (forward-line 1)
+ (while (not (or (notmuch-pick-get-prop :first) (eobp)))
+ (forward-line 1)))
+
(defun notmuch-pick-thread-mapcar (function)
"Iterate through all messages in the current thread
and call FUNCTION for side effects."