Rename internal variable

master
Elis Axelsson 9 years ago
parent 70e8fd0641
commit f08a2dcf67
No known key found for this signature in database
GPG Key ID: D57EFA625C9A925F
  1. 18
      webpaste.el

@ -69,7 +69,7 @@ default to all providers in order defined in ‘webpaste-providers’ list."
:group 'webpaste) :group 'webpaste)
(defvar webpaste-tested-providers () (defvar webpaste/tested-providers ()
"Variable for storing which providers to try in which order while running. "Variable for storing which providers to try in which order while running.
This list will be re-populated each run based on webpaste-provider-priority or This list will be re-populated each run based on webpaste-provider-priority or
if that variable is nil, it will use the list of names from webpaste-providers if that variable is nil, it will use the list of names from webpaste-providers
@ -320,7 +320,7 @@ return it to the user."
"Return RETURNED-URL to user from the result of the paste service." "Return RETURNED-URL to user from the result of the paste service."
;; Reset tested providers after successful paste ;; Reset tested providers after successful paste
(setq webpaste-tested-providers nil) (setq webpaste/tested-providers nil)
;; Add RETURNED-URL to killring for easy pasting ;; Add RETURNED-URL to killring for easy pasting
(kill-new returned-url) (kill-new returned-url)
@ -344,25 +344,25 @@ make `webpaste-paste-text' do less magic things all at once."
If webpaste-provider-priority isn't populated, it will populate it with the If webpaste-provider-priority isn't populated, it will populate it with the
default providers. default providers.
Then if webpaste-tested-providers isn't populated it will be populated by Then if webpaste/tested-providers isn't populated it will be populated by
webpaste-provider-priority. webpaste-provider-priority.
Then it extracts the first element of webpaste-tested-providers and drops Then it extracts the first element of webpaste/tested-providers and drops
the first element from that list and gets the lambda for the provider and the first element from that list and gets the lambda for the provider and
runs the lambda to paste TEXT to the paste service. The paste-service in turn runs the lambda to paste TEXT to the paste service. The paste-service in turn
might call this function again with TEXT as param to retry if it failed. might call this function again with TEXT as param to retry if it failed.
When we run out of providers to try, it will restart since When we run out of providers to try, it will restart since
webpaste-tested-providers will be empty and then populated again." webpaste/tested-providers will be empty and then populated again."
;; Populate tested providers for this request if needed ;; Populate tested providers for this request if needed
(unless webpaste-tested-providers (unless webpaste/tested-providers
(setq webpaste-tested-providers (webpaste/get-provider-priority))) (setq webpaste/tested-providers (webpaste/get-provider-priority)))
;; Get name of provider at the top of the list ;; Get name of provider at the top of the list
(let ((provider-name (car webpaste-tested-providers))) (let ((provider-name (car webpaste/tested-providers)))
;; Drop the name at the top of the list ;; Drop the name at the top of the list
(setq webpaste-tested-providers (cdr webpaste-tested-providers)) (setq webpaste/tested-providers (cdr webpaste/tested-providers))
;; Run pasting function ;; Run pasting function
(webpaste-paste-text-to-provider text provider-name))) (webpaste-paste-text-to-provider text provider-name)))

Loading…
Cancel
Save