From 3293b8a2f75aa92c348cfa82e60b6e5a1e39f088 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 11 Feb 2015 15:30:23 +0000 Subject: Define sx-question-list-order-by Command for switching the ordering method. --- sx-question-list.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sx-question-list.el') 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 -- cgit v1.2.3