[PATCH v2 2/2] emacs: Expand default saved searches and add shortcut keys

Subject: [PATCH v2 2/2] emacs: Expand default saved searches and add shortcut keys

Date: Tue, 15 Jul 2014 10:06:06 -0400

To: notmuch@notmuchmail.org

Cc:

From: Austin Clements


This should help new users off to a better start with the addition of
more sensible saved searches and default shortcut keys.  Most existing
users have probably customized this variable and won't be affected.
---
 emacs/notmuch-hello.el                              | 9 +++++++--
 test/emacs.expected-output/notmuch-hello            | 2 +-
 test/emacs.expected-output/notmuch-hello-long-names | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 061b27d..65d0627 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -93,8 +93,13 @@ (define-widget 'notmuch-saved-search-plist 'list
 				    (const :tag "Oldest-first" oldest-first)
 				    (const :tag "Newest-first" newest-first))))))
 
-(defcustom notmuch-saved-searches '((:name "inbox" :query "tag:inbox")
-				    (:name "unread" :query "tag:unread"))
+(defcustom notmuch-saved-searches
+  `((:name "inbox" :query "tag:inbox" :key ,(kbd "i"))
+    (:name "unread" :query "tag:unread" :key ,(kbd "u"))
+    (:name "flagged" :query "tag:flagged" :key ,(kbd "f"))
+    (:name "sent" :query "tag:sent" :key ,(kbd "t"))
+    (:name "drafts" :query "tag:draft" :key ,(kbd "d"))
+    (:name "all mail" :query "*" :key ,(kbd "a")))
   "A list of saved searches to display.
 
 The saved search can be given in 3 forms. The preferred way is as
diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
index 2d69891..9ba4cfc 100644
--- a/test/emacs.expected-output/notmuch-hello
+++ b/test/emacs.expected-output/notmuch-hello
@@ -2,7 +2,7 @@
 
 Saved searches: [edit]
 
-	  52 inbox           52 unread
+	  52 inbox           52 unread          52 all mail
 
 Search:                                                                     .
 
diff --git a/test/emacs.expected-output/notmuch-hello-long-names b/test/emacs.expected-output/notmuch-hello-long-names
index 486d0d9..1c8d6eb 100644
--- a/test/emacs.expected-output/notmuch-hello-long-names
+++ b/test/emacs.expected-output/notmuch-hello-long-names
@@ -2,7 +2,7 @@
 
 Saved searches: [edit]
 
-	  52 inbox           52 unread
+	  52 inbox           52 unread          52 all mail
 
 Search:                                                                     .
 
-- 
2.0.0


Thread: