From 14f219c69039b681adbb0312973ae481b96a980e Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 11 Jan 2015 19:50:38 -0200 Subject: Hotfix: Less aggressive raw links --- sx-question-print.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sx-question-print.el') diff --git a/sx-question-print.el b/sx-question-print.el index f6cd1dc..e120752 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -334,10 +334,10 @@ E.g.: (rx (or (and "[" (group-n 1 (1+ (not (any "]")))) "]" (or (and "(" (group-n 2 (1+ (not (any ")")))) ")") (and "[" (group-n 3 (1+ (not (any "]")))) "]"))) - (group-n 4 (and (or (and "http" (opt "s") "://") "") - (+ (any alnum "_%")) + (group-n 4 (and (and "http" (opt "s") "://") "" + (>= 2 (any lower numeric "_%")) "." - (+ (any alnum "/._%&#?=;")))))) + (>= 2 (any lower numeric "/._%&#?=;")))))) "Regexp matching markdown links.") (defun sx-question-mode--fill-and-fontify (text) -- cgit v1.2.3 From 766d008e12d7164053bda6d56f336af442109232 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Wed, 14 Jan 2015 08:41:38 -0500 Subject: Sort answers by score --- sx-question-print.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sx-question-print.el') 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 -- cgit v1.2.3