diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-11 15:30:23 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-11 15:42:34 +0000 |
commit | 3293b8a2f75aa92c348cfa82e60b6e5a1e39f088 (patch) | |
tree | 2338907d3e8cb84a1b4a8a7d22e66483838b21fc /sx-question-list.el | |
parent | db202249de34136cf43b9f9926d41f0964a184c6 (diff) |
Define sx-question-list-order-by
Command for switching the ordering method.
Diffstat (limited to 'sx-question-list.el')
-rw-r--r-- | sx-question-list.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index d2745db..907ff39 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -616,6 +616,19 @@ Sets `sx-question-list--site' and then call (setq sx-question-list--site site) (sx-question-list-refresh 'redisplay))) +(defun sx-question-list-order-by (sort) + "Order questions in the current list by the method SORT. +Sets `sx-question-list--order' and then calls +`sx-question-list-refresh' with `redisplay'." + (interactive + (list (when sx-question-list--order + (sx-question-list--interactive-order-prompt)))) + (unless sx-question-list--order + (sx-user-error "This list can't be reordered")) + (when (and sort (symbolp sort)) + (setq sx-question-list--order sort) + (sx-question-list-refresh 'redisplay))) + (provide 'sx-question-list) ;;; sx-question-list.el ends here |