[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste 4b32baa 203/298: Rename all the lambdas to privat
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste 4b32baa 203/298: Rename all the lambdas to private scopes |
Date: |
Thu, 9 Dec 2021 19:00:14 -0500 (EST) |
branch: elpa/webpaste
commit 4b32baa166059d41092d6a13a4babc3918fb0436
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Rename all the lambdas to private scopes
It's not meant for regular users to engage them directly.
---
.../test-webpaste-default-post-field-lambda.el | 2 +-
tests/unit/test-webpaste-error-lambdas.el | 4 +--
tests/unit/test-webpaste-success-lambdas.el | 6 ++--
webpaste.el | 36 +++++++++++-----------
4 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/tests/unit/test-webpaste-default-post-field-lambda.el
b/tests/unit/test-webpaste-default-post-field-lambda.el
index 134fbb6..3666037 100644
--- a/tests/unit/test-webpaste-default-post-field-lambda.el
+++ b/tests/unit/test-webpaste-default-post-field-lambda.el
@@ -10,7 +10,7 @@
(it
"can add language and text as post data"
- (let ((post-lambda (webpaste-providers-default-post-field-lambda))
+ (let ((post-lambda (webpaste--providers-default-post-field-lambda))
(major-mode 'fundamental-mode)
(webpaste--provider-lang-alists '(("https://example.com/" .
((fundamental-mode . "text"))))))
(let ((post-data (funcall post-lambda
diff --git a/tests/unit/test-webpaste-error-lambdas.el
b/tests/unit/test-webpaste-error-lambdas.el
index 3364f19..a8959ba 100644
--- a/tests/unit/test-webpaste-error-lambdas.el
+++ b/tests/unit/test-webpaste-error-lambdas.el
@@ -16,7 +16,7 @@
(it
"with fallback"
- (let ((error-lambda (webpaste-providers-error-lambda :text "my text")))
+ (let ((error-lambda (webpaste--providers-error-lambda :text "my text")))
(funcall error-lambda :error-thrown "my error")
(expect 'message
@@ -30,7 +30,7 @@
(it
"without fallback"
- (let ((error-lambda (webpaste-providers-error-lambda-no-failover :text "my
text")))
+ (let ((error-lambda (webpaste--providers-error-lambda-no-failover :text "my
text")))
(funcall error-lambda :error-thrown "my error")
(expect 'message
diff --git a/tests/unit/test-webpaste-success-lambdas.el
b/tests/unit/test-webpaste-success-lambdas.el
index 5a6a7e5..d8dfc6f 100644
--- a/tests/unit/test-webpaste-success-lambdas.el
+++ b/tests/unit/test-webpaste-success-lambdas.el
@@ -17,7 +17,7 @@
(it
"using a response header"
- (let ((success-lambda (webpaste-providers-success-location-header)))
+ (let ((success-lambda (webpaste--providers-success-location-header)))
(funcall success-lambda :response "my fake response")
(expect 'webpaste--return-url
@@ -27,7 +27,7 @@
(xit
"when using some request.el response thingy"
- (let ((success-lambda (webpaste-providers-success-response-url)))
+ (let ((success-lambda (webpaste--providers-success-response-url)))
(funcall success-lambda :response "my fake response")
(expect 'webpaste--return-url
@@ -38,7 +38,7 @@
(it
"when returning a string with an url"
- (let ((success-lambda (webpaste-providers-success-returned-string)))
+ (let ((success-lambda (webpaste--providers-success-returned-string)))
(funcall success-lambda :data "\"https://example.com/\"
")
diff --git a/webpaste.el b/webpaste.el
index 2a9a91f..dd72920 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -93,21 +93,21 @@ This uses `simpleclip-set-contents' to copy to clipboard."
:post-field "c"
:lang-uri-separator "/"
:lang-overrides ((emacs-lisp-mode . "elisp"))
- :success-lambda webpaste-providers-success-location-header)
+ :success-lambda webpaste--providers-success-location-header)
("ix.io"
:uri "http://ix.io/"
:post-field "f:1"
:lang-uri-separator "/"
:lang-overrides ((emacs-lisp-mode . "elisp"))
- :success-lambda webpaste-providers-success-returned-string)
+ :success-lambda webpaste--providers-success-returned-string)
("sprunge.us"
:uri "http://sprunge.us/"
:post-field "sprunge"
:lang-uri-separator "?"
:lang-overrides ((emacs-lisp-mode . "clojure"))
- :success-lambda webpaste-providers-success-returned-string)
+ :success-lambda webpaste--providers-success-returned-string)
("dpaste.com"
:uri "http://dpaste.com/api/v2/"
@@ -117,7 +117,7 @@ This uses `simpleclip-set-contents' to copy to clipboard."
:post-field "content"
:post-lang-field-name "syntax"
:lang-overrides ((emacs-lisp-mode . "clojure"))
- :success-lambda webpaste-providers-success-location-header)
+ :success-lambda webpaste--providers-success-location-header)
("dpaste.de"
:uri "https://dpaste.de/api/"
@@ -125,7 +125,7 @@ This uses `simpleclip-set-contents' to copy to clipboard."
:post-field "content"
:post-lang-field-name "lexer"
:lang-overrides ((emacs-lisp-mode . "clojure"))
- :success-lambda webpaste-providers-success-returned-string)
+ :success-lambda webpaste--providers-success-returned-string)
("gist.github.com"
:uri "https://api.github.com/gists"
@@ -148,7 +148,7 @@ This uses `simpleclip-set-contents' to copy to clipboard."
:post-field "code"
:post-lang-field-name "language"
:lang-overrides ((emacs-lisp-mode . "clojure"))
- :success-lambda webpaste-providers-success-response-url))
+ :success-lambda webpaste--providers-success-response-url))
"Define all webpaste.el providers.
Consists of provider name and arguments to be sent to `webpaste--provider' when
@@ -193,21 +193,21 @@ precalculated, and also available both for pre and post
request access.")
;;; Predefined error lambda for providers
-(cl-defun webpaste-providers-error-lambda (&key text)
+(cl-defun webpaste--providers-error-lambda (&key text)
"Predefined error callback for providers that always does failover."
(cl-function (lambda (&key error-thrown &allow-other-keys)
(message "Got error: %S" error-thrown)
(webpaste--paste-text text))))
-(cl-defun webpaste-providers-error-lambda-no-failover (&key text)
+(cl-defun webpaste--providers-error-lambda-no-failover (&key text)
"Predefined error callback for providers that shouldn't do failover."
(cl-function (lambda (&key error-thrown &allow-other-keys)
(message "Got error: %S" error-thrown))))
;;; Predefined success lambdas for providers
-(cl-defun webpaste-providers-success-location-header ()
+(cl-defun webpaste--providers-success-location-header ()
"Predefined success callback for providers returning a Location header."
(cl-function (lambda (&key response &allow-other-keys)
(when response
@@ -215,7 +215,7 @@ precalculated, and also available both for pre and post
request access.")
(request-response-header response "Location"))))))
-(cl-defun webpaste-providers-success-response-url ()
+(cl-defun webpaste--providers-success-response-url ()
"Predefined success callback for providers that and up with an URL somehow."
(cl-function (lambda (&key response &allow-other-keys)
(when response
@@ -223,7 +223,7 @@ precalculated, and also available both for pre and post
request access.")
(request-response-url response))))))
-(cl-defun webpaste-providers-success-returned-string ()
+(cl-defun webpaste--providers-success-returned-string ()
"Predefined success callback for providers returning a string with URL."
(cl-function (lambda (&key data &allow-other-keys)
(when data
@@ -233,7 +233,7 @@ precalculated, and also available both for pre and post
request access.")
(webpaste--return-url data)))))
-(cl-defun webpaste-providers-default-post-field-lambda ()
+(cl-defun webpaste--providers-default-post-field-lambda ()
"Predefined lambda for building post fields."
(cl-function (lambda (&key text
post-field
@@ -275,8 +275,8 @@ precalculated, and also available both for pre and post
request access.")
(parser 'buffer-string)
(lang-overrides '())
(lang-uri-separator nil)
- (error-lambda
'webpaste-providers-error-lambda)
- (post-field-lambda
'webpaste-providers-default-post-field-lambda))
+ (error-lambda
'webpaste--providers-error-lambda)
+ (post-field-lambda
'webpaste--providers-default-post-field-lambda))
"Function to create the lambda function for a provider.
Usage:
@@ -290,8 +290,8 @@ Required params:
:success-lambda Callback sent to `request', look up how to write these in
the
documentation for `request'. Two good examples are
- `webpaste-providers-success-location-header' and
- `webpaste-providers-success-returned-string' as well as the
+ `webpaste--providers-success-location-header' and
+ `webpaste--providers-success-returned-string' as well as the
custom one used for the gist.github.com provider.
Optional params:
@@ -315,8 +315,8 @@ Optional params:
:error-lambda Callback sent to `request', look up how to write these in
the
documentation for `request'. The default value for this is
- `webpaste-providers-error-lambda', but there's also
- `webpaste-providers-error-lambda-no-failover' available if
+ `webpaste--providers-error-lambda', but there's also
+ `webpaste--providers-error-lambda-no-failover' available if
you need a provider that isn't allowed to failover.
:post-field-lambda Function that builds and returns the post data that should
be
- [nongnu] elpa/webpaste 60c0a98 167/298: Added printing of travis event type, (continued)
- [nongnu] elpa/webpaste 60c0a98 167/298: Added printing of travis event type, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d0442ad 168/298: Renamed all unit tests to make it easier for integration tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cac4979 173/298: Added option to send returned URL to clpboard, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste db393a1 175/298: Merge branch 'naclander-copy-to-clipboard', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 92f309e 188/298: Added a contributing guidelines file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste ddd2fca 186/298: Added tests for success lambdas, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2a05d02 194/298: Added supports for custom hooks when returning URLs. This fixes #22., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b96e411 204/298: Moved the paste message to be a variable used for all integration tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 26f089e 201/298: Rename webpaste-paste-text and webpaste-paste-text-to-provider to be in "private scope", ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 90a96d2 199/298: Change emacs-lisp-mode from elisp to clojure for sprunge.us, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4b32baa 203/298: Rename all the lambdas to private scopes,
ELPA Syncer <=
- [nongnu] elpa/webpaste cc9ba3d 202/298: Begin autoloading of the webpaste group, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste aed3e00 210/298: Bump version for new release, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b8f300f 209/298: Add pattern for buttercup to not run gists.github.com on travis, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4bd15f8 227/298: Add a nix-shell file for some development utils, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f047313 219/298: Update the custom hook example to actually need to be a lambda, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste ac24701 214/298: Merge branch 'DamienCassou-simplify-travis', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6a02ff9 185/298: Added tests for error lambdas and failovers, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste bf08207 211/298: Update my name due to legal namechange, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 14fd97b 225/298: Add deprecation message of simpleclip option to clean up the code, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b6f8005 216/298: Do not fallback to true if test fails, ELPA Syncer, 2021/12/09