[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste 533bb40 290/298: Apply suggestions from code revi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste 533bb40 290/298: Apply suggestions from code review |
Date: |
Thu, 9 Dec 2021 19:00:32 -0500 (EST) |
branch: elpa/webpaste
commit 533bb406c4d68bf94476ce8800fd3c4913837aaa
Author: Dale Sedivec <dale+github@codefu.org>
Commit: Dale Sedivec <dale@codefu.org>
Apply suggestions from code review
Co-authored-by: Elis Hirwing <elis@hirwing.se>
---
README.org | 2 +-
webpaste.el | 33 +++++++++++++++++++--------------
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/README.org b/README.org
index c7e5240..d0a10f8 100644
--- a/README.org
+++ b/README.org
@@ -198,9 +198,9 @@ webpaste first and then just read the documentation by
running this:
- [X] gist.github.com
- [X] paste.pound-python.org
- [X] paste.mozilla.org
+ - [X] bpa.st
- [ ] paste.debian.net
- [ ] bpaste.net
- [ ] eval.in
- - [X] bpa.st
- [ ] ptpb.pw (RIP due to
[[https://github.com/ptpb/pb/issues/245][ptpb/pb#245]] &
[[https://github.com/ptpb/pb/issues/240][ptpb/pb#240]])
- [ ] sprunge.us (removed due to
[[https://github.com/rupa/sprunge/issues/45][sprunge#45]] that yields 500s)
diff --git a/webpaste.el b/webpaste.el
index 204dc26..fb2e404 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -160,9 +160,9 @@ This uses `browse-url-generic' to open URLs."
("bpa.st"
:uri "https://bpa.st/api/v1/paste"
:post-data (("expiry" . "1day"))
- :post-field-lambda (lambda () #'webpaste--providers-pinnwand-request)
+ :post-field-lambda webpaste--providers-pinnwand-request
:lang-overrides ((emacs-lisp-mode . "emacs"))
- :success-lambda (lambda () #'webpaste--providers-pinnwand-success)))
+ :success-lambda webpaste--providers-pinnwand-success))
"Define all webpaste.el providers.
Consists of provider name and arguments to be sent to `webpaste--provider' when
@@ -307,20 +307,25 @@ This is the default failover hook that we use for most
providers."
;; Otherwise we return the formatted post data
post-data))))
-(cl-defun webpaste--providers-pinnwand-request (&key text post-data
provider-uri
- &allow-other-keys)
+(cl-defun webpaste--providers-pinnwand-request ()
"Build request for pinnwand pastebins."
- (let* ((lexer (or (webpaste--get-buffer-language provider-uri) "text"))
- (file `(("lexer" . ,lexer) ("content" . ,text)))
- (file-name (buffer-file-name)))
- (when file-name
- (push (cons "name" (file-name-nondirectory file-name)) file))
- (json-encode `((expiry . ,(or (cdr (assoc "expiry" post-data)) "1day"))
- (files . ,(vector file))))))
-
-(cl-defun webpaste--providers-pinnwand-success (&key data &allow-other-keys)
+ (cl-function (lambda (&key text post-data provider-uri &allow-other-keys)
+ "Build request for pinnwand pastebins."
+ (let* ((lexer (or (webpaste--get-buffer-language
provider-uri) "text"))
+ (file `(("lexer" . ,lexer) ("content" . ,text)))
+ (file-name (buffer-file-name)))
+ (when file-name
+ (push (cons "name"
+ (file-name-nondirectory file-name))
+ file))
+ (json-encode `((expiry . ,(or (cdr (assoc "expiry"
post-data)) "1day"))
+ (files . ,(vector file))))))))
+
+
+(cl-defun webpaste--providers-pinnwand-success ()
"Parse JSON response from pinnwand pastebins in DATA."
- (webpaste--return-url (cdr (assq 'link (json-read-from-string data)))))
+ (cl-function (lambda (&key data &allow-other-keys)
+ (webpaste--return-url (cdr (assq 'link (json-read-from-string
data)))))))
- [nongnu] elpa/webpaste b47767f 229/298: Prefix integration test names to filter them out easily if they seem, (continued)
- [nongnu] elpa/webpaste b47767f 229/298: Prefix integration test names to filter them out easily if they seem, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 356e54f 242/298: Tests: Add unit test for webpaste--get-shebang-lang-mode, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b8e9245 230/298: Add helper function to find buffers language for provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d6a8771 250/298: Merge branch 'vapniks-patch-1', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 8f9322f 265/298: Merge branch 'tastytea-dpaste.de-new-location', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2d0f810 268/298: Merge branch 'condy0919-master', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 141376a 264/298: Change dpaste.de to dpaste.org., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1a6c0e9 263/298: Bump version number in file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7a30602 274/298: Bump version number in file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 84b5c80 279/298: readme: Add readme entry for max retries, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 533bb40 290/298: Apply suggestions from code review,
ELPA Syncer <=
- [nongnu] elpa/webpaste dacb4fb 289/298: Add support for bpa.st pastebin, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 9ffa782 286/298: readme: Useful links in badges, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste a60d262 285/298: readme: Add status badges, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 65f664d 298/298: elpaignore: Add .elpaignore to ignore files in elpa builds, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 76d740e 283/298: travis: Drop travis, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 935eb5f 195/298: Remove :tangle yes from README, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 5c63d75 196/298: Added unit test for running hooks on return, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6114da7 208/298: Refactor how integration tests are triggered, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 9d026d6 212/298: Remove emacs-24.3 from build target, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cf2ea41 218/298: Update heading levels and add a TOC, ELPA Syncer, 2021/12/09