emacs-elpa-diffs
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]