aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2015-01-04 12:16:00 -0500
committerSean Allred <code@seanallred.com>2015-01-04 12:17:19 -0500
commitf5efa010e4c16eda6d3652b325efaf524acd9422 (patch)
tree9131460647c24af8ae3eaf738fe0e0323006ec30
parent0e03d9086eedd486a4492e5f198e45990ad5a3bf (diff)
Add page and pagesize only if not already present
-rw-r--r--sx-method.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/sx-method.el b/sx-method.el
index e0764fb..e68a4ea 100644
--- a/sx-method.el
+++ b/sx-method.el
@@ -60,6 +60,9 @@ authentication.
:PAGE is the page number which will be requested
:PAGESIZE is the number of items to retrieve per request, default 100
+Any conflicting information in :KEYWORDS overrides the :PAGE
+and :PAGESIZE settings.
+
When AUTH is nil, it is assumed that no auth-requiring filters or
methods will be used. If they are an error will be signaled. This is
to ensure awareness of where auth is needed.
@@ -127,8 +130,10 @@ Return the entire response as a complex alist."
(error "This request requires authentication."))))
;; Concatenate all parameters now that filter is ensured.
(push `(filter . ,(sx-filter-get-var filter)) keywords)
- (push `(page . ,page) keywords)
- (push `(pagesize . ,pagesize) keywords)
+ (unless (assq 'page keywords)
+ (push `(page . ,page) keywords))
+ (unless (assq 'pagesize keywords)
+ (push `(pagesize . ,pagesize) keywords))
(when site
(push `(site . ,site) keywords))
(funcall call