[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste dab97dd 130/298: Make post-fields-lambda take nam
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste dab97dd 130/298: Make post-fields-lambda take named parameters |
Date: |
Thu, 9 Dec 2021 18:59:59 -0500 (EST) |
branch: elpa/webpaste
commit dab97dd11b0e5886c4c401fff917474ee757c2aa
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Make post-fields-lambda take named parameters
---
webpaste.el | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/webpaste.el b/webpaste.el
index 58bb624..4ff653e 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -94,10 +94,12 @@ each run.")
(defvar webpaste/providers-default-post-field-lambda
- (lambda (text post-field post-data)
- (cl-pushnew (cons post-field text) post-data)
+ (cl-function (lambda (&key text
+ post-field
+ (post-data '()))
+ (cl-pushnew (cons post-field text) post-data)
- post-data)
+ post-data))
"Predefined lambda for building post fields.")
@@ -143,8 +145,9 @@ Optional params:
you need a provider that isn't allowed to failover.
:post-field-lambda Function that builds and returns the post data that should
be
- sent to the provider. It should accept the parameter TEXT,
- POST-FIELD and POST-DATA.
+ sent to the provider. It should accept named parameters by
+ the names TEXT, POST-FIELD and POST-DATA. POST-DATA should
+ default to `nil' or empty list.
TEXT contains the data that should be sent.
POST-FIELD cointains the name of the field to be sent.
@@ -159,7 +162,10 @@ Optional params:
;; Do request
(request uri
:type type
- :data (funcall post-field-lambda text post-field post-data)
+ :data (funcall post-field-lambda
+ :text text
+ :post-field post-field
+ :post-data post-data)
:parser parser
:success success-lambda
:sync sync
@@ -210,12 +216,12 @@ Optional params:
,(webpaste-provider
:uri "https://api.github.com/gists"
:post-field nil
- :post-field-lambda (lambda (text post-field post-data)
+ :post-field-lambda (cl-function (lambda (&key text post-field
(post-data '()))
(json-encode `(("description" . "Pasted from Emacs
with webpaste.el")
("public" . "false")
("files" .
(("file.txt" .
- (("content" . ,text))))))))
+ (("content" . ,text)))))))))
:success-lambda (cl-function (lambda (&key data &allow-other-keys)
(when data
(webpaste-return-url
- [nongnu] elpa/webpaste 72ba31e 127/298: Bump version for new release, (continued)
- [nongnu] elpa/webpaste 72ba31e 127/298: Bump version for new release, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7d03ed3 137/298: Removed unused variables defined in function declaration, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 07a85e9 142/298: Added pre-calculated alist of languages for providers, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7b84568 155/298: Avoid setq's in favor of let, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 0c0e88a 079/298: Added basic structure of tests file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 95289e5 082/298: Added .travis.yml config file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7c90bc5 090/298: Merge branch 'tarsius-master', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste ec85d7d 092/298: Added unit test for static provider configuration, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2c5eb3c 149/298: Fix broken build., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f161620 163/298: Refactored the success callbacks, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste dab97dd 130/298: Make post-fields-lambda take named parameters,
ELPA Syncer <=
- [nongnu] elpa/webpaste f83fd7b 145/298: Added note about new provider to implement. This refs #7, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 62e0f33 165/298: Refactor default post field lambda, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6e116ea 166/298: Merge branch 'refactor-away-defvars', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1677cd2 171/298: Added stuff to Makefile to run integration tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 51a6a07 174/298: Fixed broken message format, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6086556 180/298: Added integration tests for dpaste.com, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 44364f4 109/298: Rename parameter domain to uri for webpaste-provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1a1144f 110/298: Exposed sync parameter of request for debugging/test purposes, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d9529de 112/298: Replaced (if (eq VAR nil)) with (unless VAR), ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1bfa9ec 120/298: Bump version for stable release and copyright year, ELPA Syncer, 2021/12/09