aboutsummaryrefslogtreecommitdiff
path: root/stack-core.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-01 01:34:39 -0400
committerSean Allred <code@seanallred.com>2014-11-01 01:34:39 -0400
commit51612733ae7948645632b044cf527e4f088cb804 (patch)
treeb5da8c40a48a1954fc8f530b13b5edb6724cc7f5 /stack-core.el
parent94c434227d60e38d305e48043522774bcfa8ef31 (diff)
Use `url-retrieve-synchronously' dependendently
Emacs 24.3 supposedly does not have a second argument to `url-retrieve-synchronously'. Introduce a switch dependent on `emacs-minor-version'. This hopefully fixes the url- issue.
Diffstat (limited to 'stack-core.el')
-rw-r--r--stack-core.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/stack-core.el b/stack-core.el
index 16a20c9..03a3afa 100644
--- a/stack-core.el
+++ b/stack-core.el
@@ -150,6 +150,7 @@ optional KEYWORD-ARGUMENTS. If no KEYWORD-ARGUMENTS are given,
`stack-core-default-keyword-arguments-alist' is used. Return the
entire response as a complex alist."
(let ((url-automatic-caching stack-core-cache-requests)
+ (url-inhibit-uncompression t)
(call
(stack-core-build-request
method
@@ -160,8 +161,11 @@ entire response as a complex alist."
;; TODO: url-retrieve-synchronously can return nil if the call is
;; unsuccessful should handle this case
(unless silent (stack-message "Request: %S" call))
- (let ((response-buffer (url-retrieve-synchronously
- call silent)))
+ (let ((response-buffer (cond
+ ((= emacs-minor-version 4)
+ (url-retrieve-synchronously call silent))
+ ((= emacs-minor-version 3)
+ (url-retrieve-synchronously call)))))
(if (not response-buffer)
(error "Something went wrong in `url-retrieve-synchronously'")
(with-current-buffer response-buffer