aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-12 23:16:19 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-12 23:16:19 -0800
commit8561c7463a5de3bd0990d8244abb1c67ca4f4a7d (patch)
tree0f3ad8babbcef69b593f0f20d6e8c80c97cea6f1 /notmuch.el
parented2643333c3e347318cdf78f888fc2eb4e89d2ad (diff)
notmuch.el: Add a binding ('o') and command to toggle current search order.
This ended up being a bit easier than I thought. Just flip the controlling variable and then run `notmuch-search-refresh-view'.
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/notmuch.el b/notmuch.el
index 05e7c4d1..87239764 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -615,6 +615,7 @@ thread from that buffer can be show when done with this one)."
(define-key map "b" 'notmuch-search-scroll-down)
(define-key map "f" 'notmuch-search-filter)
(define-key map "n" 'next-line)
+ (define-key map "o" 'notmuch-search-toggle-order)
(define-key map "p" 'previous-line)
(define-key map "q" 'kill-this-buffer)
(define-key map "s" 'notmuch-search)
@@ -820,6 +821,24 @@ same relative position within the new buffer."
(beginning-of-line)
(goto-char here))))
+(defun notmuch-search-toggle-order ()
+ "Toggle the current search order.
+
+By default, the \"inbox\" view created by `notmuch' is displayed
+in chronological order (oldest thread at the beginning of the
+buffer), while any global searches created by `notmuch-search'
+are displayed in reverse-chronological order (newest thread at
+the beginning of the buffer).
+
+This command toggles the sort order for the current search.
+
+Note that any fitlered searches created by
+`notmuch-search-filter' retain the search order of the parent
+search."
+ (interactive)
+ (set 'notmuch-search-oldest-first (not notmuch-search-oldest-first))
+ (notmuch-search-refresh-view))
+
(defun notmuch-search-filter (query)
"Filter the current search results based on an additional query string.