diff options
author | Sean Allred <code@seanallred.com> | 2014-11-01 01:34:39 -0400 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-01 01:34:39 -0400 |
commit | 51612733ae7948645632b044cf527e4f088cb804 (patch) | |
tree | b5da8c40a48a1954fc8f530b13b5edb6724cc7f5 | |
parent | 94c434227d60e38d305e48043522774bcfa8ef31 (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.
-rw-r--r-- | Cask | 1 | ||||
-rw-r--r-- | stack-core.el | 8 |
2 files changed, 7 insertions, 2 deletions
@@ -6,6 +6,7 @@ (files "stack-*.el") (depends-on "json" "1.4") +(depends-on "url") (development (depends-on "ert")) 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 |