aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Mark Walters <markwalters1009@gmail.com>2014-04-12 13:46:26 +0100
committerGravatar David Bremner <david@tethera.net>2014-04-14 23:17:20 -0300
commit2fc72a185424125597c9e13f6bdaf6fcd55c08c7 (patch)
tree596f40bc1371250f0c9e1967c0e62106ee533de4 /emacs
parent16a3103023749a8bf1d9bcc232fd50527abe6876 (diff)
emacs: hello: bugfix: make alphabetically sorted saved searches work
My recent changes to the saved search format broke the alphabetically sorted saved sort option. This makes it work again. Also update docs for saved-search sort defcustom to match the new format. Finally, since the saved-search list is no longer an alist change the names in the sort function to avoid confusion.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-hello.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 4900a242..b8ec665d 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -39,9 +39,12 @@
:type 'boolean
:group 'notmuch-hello)
-(defun notmuch-sort-saved-searches (alist)
- "Generate an alphabetically sorted saved searches alist."
- (sort (copy-sequence alist) (lambda (a b) (string< (car a) (car b)))))
+(defun notmuch-sort-saved-searches (saved-searches)
+ "Generate an alphabetically sorted saved searches list."
+ (sort (copy-sequence saved-searches)
+ (lambda (a b)
+ (string< (notmuch-saved-search-get a :name)
+ (notmuch-saved-search-get b :name)))))
(defcustom notmuch-saved-search-sort-function nil
"Function used to sort the saved searches for the notmuch-hello view.
@@ -51,8 +54,10 @@ sorting (nil) displays the saved searches in the order they are
stored in `notmuch-saved-searches'. Sort alphabetically sorts the
saved searches in alphabetical order. Custom sort function should
be a function or a lambda expression that takes the saved
-searches alist as a parameter, and returns a new saved searches
-alist to be used."
+searches list as a parameter, and returns a new saved searches
+list to be used. For compatibility with the various saved-search
+formats it should use notmuch-saved-search-get to access the
+fields of the search."
:type '(choice (const :tag "No sorting" nil)
(const :tag "Sort alphabetically" notmuch-sort-saved-searches)
(function :tag "Custom sort function"