aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-question-list.el13
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