aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-compose.el3
-rw-r--r--sx-question-print.el13
-rw-r--r--sx-request.el2
3 files changed, 12 insertions, 6 deletions
diff --git a/sx-compose.el b/sx-compose.el
index 67c476e..3047a97 100644
--- a/sx-compose.el
+++ b/sx-compose.el
@@ -34,6 +34,7 @@
(require 'markdown-mode)
(require 'sx)
+(require 'sx-tag)
(defgroup sx-compose-mode nil
"Customization group for sx-compose-mode."
@@ -199,7 +200,7 @@ tags. Return a list of already inserted tags."
(if invalid-tags
;; If the user doesn't want to create the tags, we return
;; nil and sending is aborted.
- (y-or-n-p "Following tags don't exist. Create them? %s " invalid-tags)
+ (y-or-n-p (format "Following tags don't exist. Create them? %s " invalid-tags))
t))))
diff --git a/sx-question-print.el b/sx-question-print.el
index f6cd1dc..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
@@ -334,10 +339,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)
diff --git a/sx-request.el b/sx-request.el
index 9a788ca..2650c55 100644
--- a/sx-request.el
+++ b/sx-request.el
@@ -218,7 +218,7 @@ Currently returns nil."
;;; Our own generated data
(defconst sx-request--data-url-format
- "http://raw.githubusercontent.com/vermiculus/sx.el/data/data/%s.el"
+ "https://raw.githubusercontent.com/vermiculus/sx.el/data/data/%s.el"
"Url of the \"data\" directory inside the SX `data' branch.")
(defun sx-request-get-data (file)