aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-compose.el3
-rw-r--r--sx-favorites.el6
-rw-r--r--sx-inbox.el1
-rw-r--r--sx-question-print.el13
-rw-r--r--sx-request.el2
-rw-r--r--sx-site.el1
6 files changed, 18 insertions, 8 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-favorites.el b/sx-favorites.el
index d98b4c2..444df29 100644
--- a/sx-favorites.el
+++ b/sx-favorites.el
@@ -45,8 +45,10 @@ Added as hook to initialization."
(or (setq sx-favorites--user-favorite-list
(sx-cache-get 'question-favorites))
(sx-favorites-update)))
-;; Append to ensure `sx-network--initialize is run before it.
-(add-hook 'sx-init--internal-hook #'sx-favorites--initialize 'append)
+;; ;; Append to ensure `sx-network--initialize' is run before it.
+;; This is removed for now because it performs a lot of API calls and
+;; was never used.
+;; (add-hook 'sx-init--internal-hook #'sx-favorites--initialize 'append)
(defun sx-favorites--retrieve-favorites (site)
"Obtain list of starred QUESTION_IDs for SITE."
diff --git a/sx-inbox.el b/sx-inbox.el
index 1efceb1..21589fb 100644
--- a/sx-inbox.el
+++ b/sx-inbox.el
@@ -69,6 +69,7 @@ KEYWORDS are added to the method call along with PAGE.
`sx-method-call' is used with `sx-inbox-filter'."
(sx-method-call (if notifications 'notifications 'inbox)
:keywords keywords
+ :page page
:filter sx-inbox-filter))
diff --git a/sx-question-print.el b/sx-question-print.el
index 7881b52..9a51efb 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -166,7 +166,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
@@ -315,10 +320,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)
diff --git a/sx-site.el b/sx-site.el
index 9b2ea34..4dac8e6 100644
--- a/sx-site.el
+++ b/sx-site.el
@@ -33,6 +33,7 @@
((site site_type
name
api_site_parameter
+ site_url
related_sites)
(related_site api_site_parameter
relation)))