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.
master
Elis Axelsson 9 years ago
parent 8027e6e44d
commit e48584700d
No known key found for this signature in database
GPG Key ID: D57EFA625C9A925F
  1. 10
      webpaste.el

@ -203,6 +203,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.
@ -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

Loading…
Cancel
Save