aboutsummaryrefslogtreecommitdiff
path: root/sx-search.el
diff options
context:
space:
mode:
authorArtur Malabarba <Malabarba@users.noreply.github.com>2015-03-26 20:53:26 +0000
committerArtur Malabarba <Malabarba@users.noreply.github.com>2015-03-26 20:53:26 +0000
commiteb62c729042c55ac7335ecee807b82e3c4c7fc5b (patch)
tree1d0337b03364cfce2fd0b700d48c1200703c2e73 /sx-search.el
parentce6600296875e17009e2b85c769956cde55a2d53 (diff)
parent542bcc6a8be0dc5b28bfe43d7e954f4476c7f02a (diff)
Merge pull request #257 from vermiculus/more-ordering
More ordering
Diffstat (limited to 'sx-search.el')
-rw-r--r--sx-search.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/sx-search.el b/sx-search.el
index b245cbe..d0fa892 100644
--- a/sx-search.el
+++ b/sx-search.el
@@ -65,13 +65,18 @@ KEYWORDS is passed to `sx-method-call'."
(defconst sx-search--order-methods
(cons '("Relevance" . relevance)
- (cl-remove-if (lambda (x) (eq (cdr x) 'hot))
- (default-value 'sx-question-list--order-methods)))
+ (default-value 'sx-question-list--order-methods))
"Alist of possible values to be passed to the `sort' keyword.")
-(defvar sx-search-default-order 'activity
+(defcustom sx-search-default-order 'activity
"Default ordering method used on new searches.
-Possible values are the cdrs of `sx-search--order-methods'.")
+Possible values are the cdrs of `sx-search--order-methods'."
+ :type (cons 'choice
+ (mapcar (lambda (c) `(const :tag ,(car c) ,(cdr c)))
+ (cl-remove-duplicates
+ sx-search--order-methods
+ :key #'cdr)))
+ :group 'sx-question-list)
;;;###autoload
@@ -111,6 +116,7 @@ prefix argument, the user is asked for everything."
(sx-search-get-questions
sx-question-list--site page
query tags excluded-tags
+ (cons 'order (if sx-question-list--descending 'desc 'asc))
(cons 'sort sx-question-list--order))))
(setq sx-question-list--site site)
(setq sx-question-list--order sx-search-default-order)