[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste e485847 107/298: Break out pasting to provider to
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste e485847 107/298: Break out pasting to provider to own function |
Date: |
Thu, 9 Dec 2021 18:59:54 -0500 (EST) |
branch: elpa/webpaste
commit e48584700d06957b31392eb8c51c9c122d7c2db7
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Break out pasting to provider to own function
This makes it easier to make custom pasting functions that will try a
spacific provider to begin with, it won't *only* try that provider
since the failover is the same as always which might be suboptimal, I
would like to make that an option so one can decide to only ever use
one provider and just fail if one wants to.
This is good if you have internal systems at offices for example, that
you have an internal paste provider for example github
enterprise. Then you don't want it to go try some other provider
afterwards.
---
webpaste.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/webpaste.el b/webpaste.el
index 1ba4624..c96d77d 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -204,6 +204,14 @@ return it to the user."
;;;###autoload
+(defun webpaste-paste-text-to-provider (text provider-name)
+ "Paste TEXT to specific PROVIDER-NAME.
+This function sends a paste to a spacific provider. This function is created
to
+make `webpaste-paste-text' do less magic things all at once."
+ (funcall (cadr (assoc provider-name webpaste-providers-alist)) text))
+
+
+;;;###autoload
(defun webpaste-paste-text (text)
"Paste TEXT to some paste service.
If ‘webpaste-provider-priority’ isn't populated, it will populate it with the
@@ -230,7 +238,7 @@ When we run out of providers to try, it will restart since
(setq webpaste-tested-providers (cdr webpaste-tested-providers))
;; Run pasting function
- (funcall (cadr (assoc provider-name webpaste-providers-alist)) text)))
+ (webpaste-paste-text-to-provider text provider-name)))
;;;###autoload
- [nongnu] elpa/webpaste 70e8fd0 135/298: Bump version for new release, (continued)
- [nongnu] elpa/webpaste 70e8fd0 135/298: Bump version for new release, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b03b90f 138/298: Add confirmation dialog of paste, before pasting, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f0a36e2 140/298: Added some docs of how to enable the confirmation dialog before pasting, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 272757b 056/298: Change documentation string, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 58f66ef 069/298: Bump version to prepare for melpa stable, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6e34759 072/298: Added another privider to list to implement, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f378ca9 075/298: Added Cask file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2bb8a4c 077/298: Set up tests directory, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f338ca7 083/298: Added Travis-CI build status image, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f658339 096/298: Bump version number for stable release, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste e485847 107/298: Break out pasting to provider to own function,
ELPA Syncer <=
- [nongnu] elpa/webpaste 406d713 115/298: Shared success lambdas between different paste providers, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7f62fed 118/298: Tidy up some lists in tests with backquotes, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 0e4ac51 132/298: Added support for buffer-language depending on mode for some providers, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 9ddc617 133/298: Simplify webpaste/get-lang-alist-with-overrides implementation, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f08a2dc 136/298: Rename internal variable, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste af0474e 139/298: Merge branch 'naclander-master', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b9b2ce0 143/298: Added support for languages for providers that appends language to the URL, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste c091dab 146/298: Change some types based on actual use, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 0144016 147/298: Remove unused variable, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b5491ab 150/298: Bump version for stable release, ELPA Syncer, 2021/12/09