diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-27 01:00:32 -0300 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-27 01:00:32 -0300 |
commit | 0542f3a5461c9f8112f0921c56bd1a7ec51d1a6f (patch) | |
tree | 2c75fa339d03d3d4eaa2e90779de82696ffa838f | |
parent | a6763f4257829e65b7602f0965a19a7efc310442 (diff) |
Bind :json-false to nil
-rw-r--r-- | sx-request.el | 10 | ||||
-rw-r--r-- | sx-user.el | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sx-request.el b/sx-request.el index 3bcea21..1eabc41 100644 --- a/sx-request.el +++ b/sx-request.el @@ -190,7 +190,9 @@ the main content of the response is returned." ;; @TODO should use `condition-case' here -- set ;; RESPONSE to 'corrupt or something (response (with-demoted-errors "`json' error: %S" - (json-read-from-string data)))) + (let ((json-false nil) + (json-null :null)) + (json-read-from-string data))))) (kill-buffer response-buffer) (when (and (not response) (string-equal data "{}")) (sx-message "Unable to parse response: %S" response) @@ -199,13 +201,13 @@ the main content of the response is returned." (sx-assoc-let response (when .error_id (error "Request failed: (%s) [%i %s] %S" - .method .error_id .error_name .error_message)) + .method .error_id .error_name .error_message)) (when (< (setq sx-request-remaining-api-requests .quota_remaining) sx-request-remaining-api-requests-message-threshold) (sx-message "%d API requests remaining" sx-request-remaining-api-requests)) (funcall (or process-function #'sx-request-response-get-items) - response))))))) + response))))))) (defun sx-request-fallback (_method &optional _args _request-method _process-function) "Fallback method when authentication is not available. @@ -308,7 +310,7 @@ false, use the symbol `false'. Each element is processed with (defun sx-request-all-stop-when-no-more (response) (or (not response) - (equal :json-false (cdr (assoc 'has_more response))))) + (not (cdr (assoc 'has_more response))))) (provide 'sx-request) ;;; sx-request.el ends here @@ -41,7 +41,7 @@ (creation_date . -1) (display_name . "(unknown user)") (down_vote_count . -1) - (is_employee . :json-false) + (is_employee . nil) (last_access_date . -1) (last_modified_date . -1) (link . "") |