aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-question-print.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/sx-question-print.el b/sx-question-print.el
index e120752..737844a 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -179,7 +179,12 @@ QUESTION must be a data structure returned by `json-read'."
;; Print everything
(sx-question-mode--print-section question)
(sx-assoc-let question
- (mapc #'sx-question-mode--print-section .answers))
+ (mapc #'sx-question-mode--print-section
+ (cl-sort .answers
+ ;; Highest-voted first. @TODO: custom sorting
+ (lambda (a b)
+ (> (cdr (assoc 'score a))
+ (cdr (assoc 'score b)))))))
(insert "\n\n ")
(insert-text-button "Write an Answer" :type 'sx-button-answer)
;; Go up