aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-cache.el3
-rw-r--r--sx-filter.el2
-rw-r--r--sx-question-list.el4
-rw-r--r--sx-question-print.el2
-rw-r--r--sx-request.el5
-rw-r--r--sx.el2
6 files changed, 11 insertions, 7 deletions
diff --git a/sx-cache.el b/sx-cache.el
index 3a5bd3b..3e8e08f 100644
--- a/sx-cache.el
+++ b/sx-cache.el
@@ -34,8 +34,7 @@
;;; Code:
-(defcustom sx-cache-directory
- (expand-file-name ".sx" user-emacs-directory)
+(defcustom sx-cache-directory (locate-user-emacs-file ".sx")
"Directory containing cached data."
:type 'directory
:group 'sx)
diff --git a/sx-filter.el b/sx-filter.el
index d341032..a3f6861 100644
--- a/sx-filter.el
+++ b/sx-filter.el
@@ -112,6 +112,7 @@ return the compiled filter."
((question body_markdown
bounty_amount
comments
+ creation_date
answers
answer_count
score
@@ -142,6 +143,7 @@ return the compiled filter."
post_id
comment_id)
(answer answer_id
+ creation_date
last_editor
last_activity_date
link
diff --git a/sx-question-list.el b/sx-question-list.el
index c72dc0d..1b7fe5a 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -184,8 +184,8 @@ Also see `sx-question-list-refresh'."
" "
(let-alist .owner
(format "%15s %5s"
- (propertize .display_name 'face 'sx-question-list-user)
- (propertize (number-to-string .reputation)
+ (propertize (or .display_name "") 'face 'sx-question-list-user)
+ (propertize (number-to-string (or .reputation 0))
'face 'sx-question-list-reputation)))
(propertize " " 'display "\n")))))))
diff --git a/sx-question-print.el b/sx-question-print.el
index e148d5f..e2db76f 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -276,7 +276,7 @@ DATA can represent a question or an answer."
(defun sx-question-mode--propertize-display-name (author)
"Return display_name of AUTHOR with `sx-question-mode-author' face."
(sx-assoc-let author
- (propertize .display_name
+ (propertize (or .display_name "??")
'face 'sx-question-mode-author)))
(defun sx-question-mode--print-comment (comment-data)
diff --git a/sx-request.el b/sx-request.el
index e91ac18..f892367 100644
--- a/sx-request.el
+++ b/sx-request.el
@@ -131,6 +131,8 @@ access the response wrapper."
(vconcat return-value
(cdr (assoc 'items response)))))
+;;; NOTE: Whenever this is arglist changes, `sx-request-fallback' must
+;;; also change.
(defun sx-request-make (method &optional args request-method process-function)
"Make a request to the API, executing METHOD with ARGS.
You should almost certainly be using `sx-method-call' instead of
@@ -189,6 +191,7 @@ the main content of the response is returned."
;; RESPONSE to 'corrupt or something
(response (with-demoted-errors "`json' error: %S"
(json-read-from-string data))))
+ (kill-buffer response-buffer)
(when (and (not response) (string-equal data "{}"))
(sx-message "Unable to parse response: %S" response)
(error "Response could not be read by `json-read-from-string'"))
@@ -204,7 +207,7 @@ the main content of the response is returned."
(funcall (or process-function #'sx-request-response-get-items)
response)))))))
-(defun sx-request-fallback (_method &optional _args _request-method)
+(defun sx-request-fallback (_method &optional _args _request-method _process-function)
"Fallback method when authentication is not available.
This is for UI generation when the associated API call would
require authentication.
diff --git a/sx.el b/sx.el
index 8680fc3..e080271 100644
--- a/sx.el
+++ b/sx.el
@@ -90,7 +90,7 @@ with a `link' property)."
(defun sx--link-to-data (link)
"Convert string LINK into data that can be displayed."
- (let ((result (list (cons 'site (sx--site link)))))
+ (let ((result (list (cons 'site_par (sx--site link)))))
;; Try to strip a question or answer ID
(when (or
;; Answer