From d0e0b26fb00a7cda45078398d056de524afc6d2d Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Wed, 5 Nov 2014 19:25:19 -0500 Subject: Implement OAuth2 authentication Tested with commit 1749aa32c25d8eee9ca0753cb55bd7d134f320b7, current HEAD of the `gh-pages' branch. --- stack-core.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'stack-core.el') diff --git a/stack-core.el b/stack-core.el index c78c316..2e9b652 100644 --- a/stack-core.el +++ b/stack-core.el @@ -57,6 +57,10 @@ (format "http://api.stackexchange.com/%s/" stack-core-api-version) "The base URL to make requests from.") +(defconst stack-core-api-batch-request-separator + ";" + "The separator character to use when making batch requests.") + (defcustom stack-core-default-keyword-arguments-alist '(("filters/create") ("sites") @@ -110,7 +114,10 @@ a string, just return it." (cond ((stringp thing) thing) ((symbolp thing) (symbol-name thing)) - ((numberp thing) (number-to-string thing)))) + ((numberp thing) (number-to-string thing)) + ((sequencep thing) + (mapconcat #'stack-core-thing-as-string + thing stack-core-api-batch-request-separator)))) (defun stack-core-get-default-keyword-arguments (method) "Gets the correct keyword arguments for METHOD." -- cgit v1.2.3 From c12e332149f3183888119701fc3c257af6bd4324 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Wed, 5 Nov 2014 19:25:43 -0500 Subject: Further explain `stack-cache-directory' I looked at it for a few minutes and wondered how to use it -- and I wrote the thing! :) --- stack-core.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stack-core.el') diff --git a/stack-core.el b/stack-core.el index 2e9b652..585cc73 100644 --- a/stack-core.el +++ b/stack-core.el @@ -274,7 +274,9 @@ context of `stack-cache-directory'." "Set the content of CACHE to DATA. As with `stack-cache-get', CACHE is a file name within the -context of `stack-cache-directory'." +context of `stack-cache-directory'. + +DATA will be written as returned by `prin1'." (unless (file-exists-p stack-cache-directory) (mkdir stack-cache-directory)) (write-region (prin1-to-string data) nil -- cgit v1.2.3 From ccb2f03dd57e4535c6151b72fc439b23acf1b643 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Thu, 6 Nov 2014 07:33:35 -0500 Subject: Change constant to variable As it is let-bound in the authentication flow, it is not truly a constant. Add a warning to the documentation appropriately. --- stack-core.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'stack-core.el') diff --git a/stack-core.el b/stack-core.el index 585cc73..6c5e7fa 100644 --- a/stack-core.el +++ b/stack-core.el @@ -57,9 +57,11 @@ (format "http://api.stackexchange.com/%s/" stack-core-api-version) "The base URL to make requests from.") -(defconst stack-core-api-batch-request-separator +(defvar stack-core-api-batch-request-separator ";" - "The separator character to use when making batch requests.") + "The separator character to use when making batch requests. + +Do not change this unless you know what you are doing!") (defcustom stack-core-default-keyword-arguments-alist '(("filters/create") -- cgit v1.2.3