aboutsummaryrefslogtreecommitdiff
path: root/sx-question.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-16 12:16:45 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-16 12:16:45 -0200
commit402bac079cd32d1260ea839667db639f94f4254e (patch)
tree1eaeea3e78200995ad746251a83624b81a99ec35 /sx-question.el
parent6378af6a432f42b99487631117d3ee781fa17b0b (diff)
parent389e433953bba4003b102748dbbf5f8a9b421a51 (diff)
Merge branch 'master' into malabarba/fix-display-from-inbox
Conflicts: sx.el
Diffstat (limited to 'sx-question.el')
-rw-r--r--sx-question.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/sx-question.el b/sx-question.el
index 35eabc8..1df4900 100644
--- a/sx-question.el
+++ b/sx-question.el
@@ -207,6 +207,21 @@ If no cache exists for it, initialize one with SITE."
"Formats TAG for display."
(concat "[" tag "]"))
+
+;;; Question Mode Answer-Sorting Functions
+
+(sx--create-comparator sx-answer-higher-score-p
+ "Return t if answer A has a higher score than answer B."
+ #'> (lambda (x) (cdr (assq 'score x))))
+
+(sx--create-comparator sx-answer-newer-p
+ "Return t if answer A was posted later than answer B."
+ #'> (lambda (x) (cdr (assq 'creation_date x))))
+
+(sx--create-comparator sx-answer-more-active-p
+ "Return t if answer A was updated after answer B."
+ #'> (lambda (x) (cdr (assq 'last_activity_date x))))
+
(provide 'sx-question)
;;; sx-question.el ends here