diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 13:40:58 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 13:43:50 -0200 |
commit | 7af796271661571791cb338c64769a3dd1f416e5 (patch) | |
tree | 5448773637473848c783f75db5815a2047f71dea | |
parent | 590b4c52574c7fcdeaf21b44ecea9cbb861ccfca (diff) |
Define ordering variables for tabs
-rw-r--r-- | sx-tab.el | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -53,6 +53,30 @@ t))) (funcall (intern (format "sx-tab-%s" (downcase tab))))) +(defconst sx-tab--order-methods + `(,@(default-value 'sx-question-list--order-methods) + ("Hottest Now" . hot) + ("Weekly Hottest" . week) + ("Monthly Hottest" . month)) + "Alist of possible values to be passed to the `sort' keyword.") + +(defcustom sx-tab-default-order 'activity + "Default ordering method used on `sx-tab-questions' and the likes. +Possible values are the cdrs of `sx-tab--order-methods'." + :type (cons 'choice + (mapcar (lambda (c) `(const :tag ,(car c) ,(cdr c))) + (cl-remove-duplicates + sx-tab--order-methods + :key #'cdr)))) + +(defconst sx-tab--docstring-format + "Display a list of %s questions for SITE. +The variable `sx-tab-default-order' can be used to customize the +sorting of the resulting list. + +NO-UPDATE (the prefix arg) is passed to `sx-question-list-refresh'. +If SITE is nil, use `sx-default-site'.") + ;;; The main macro (defmacro sx-tab--define (tab pager &optional printer refresher |