Merge branch 'naclander-copy-to-clipboard'

master
Elis Axelsson 9 years ago
commit db393a1e10
No known key found for this signature in database
GPG Key ID: D57EFA625C9A925F
  1. 21
      README.org
  2. 20
      webpaste.el

@ -68,7 +68,26 @@ Example:
Can also be put in the =:config= section of =use-package= the same way as the Can also be put in the =:config= section of =use-package= the same way as the
provider definitions above. provider definitions above.
*** Open recently created pastes in browser *** View recently created pastes
Webpaste gives you several options to view your succesful paste.
**** Send the returned URL to the killring
This is webpaste's default behavior. After a succesfull paste, the returned URL
from the provider will be sent to the killring. You can disable this with
#+BEGIN_SRC emacs-lisp
(setq webpaste/add-to-killring nil)
#+END_SRC
**** Copy URL to the clipboard
If you have [[https://github.com/rolandwalker/simpleclip][simpleclip]] installed, you can copy the returned URL to the
clipboard. You can enable this with
#+BEGIN_SRC emacs-lisp
(setq webpaste/copy-to-clipboard t)
#+END_SRC
**** Open the recently created paste in the browser
To enable opening of recently created pastes in an external browser, you can To enable opening of recently created pastes in an external browser, you can
enable the option =webpaste/open-in-browser= by setting this value to a enable the option =webpaste/open-in-browser= by setting this value to a
non-nil value. non-nil value.

@ -65,6 +65,14 @@ default to all providers in order defined in ‘webpaste-providers’ list."
This uses `browse-url-generic' to open URLs." This uses `browse-url-generic' to open URLs."
:group 'webpaste) :group 'webpaste)
(defcustom webpaste/copy-to-clipboard nil
"Uses simpleclip to send the provider's returned URL to the clipboard"
:group 'webpaste)
(defcustom webpaste/add-to-killring t
"Add the returned URL to the killring after paste"
:group 'webpaste)
(defvar webpaste/tested-providers () (defvar webpaste/tested-providers ()
@ -388,11 +396,15 @@ return it to the user.")
(when webpaste/open-in-browser (when webpaste/open-in-browser
(browse-url-generic returned-url)) (browse-url-generic returned-url))
;; Add RETURNED-URL to killring for easy pasting ;; Send RETURNED-URL to the clipboard using simpleclip
(kill-new returned-url) (when webpaste/copy-to-clipboard
(simpleclip-set-contents returned-url)
(message "URL copied to clipboard. "))
;; Notify user ;; Add RETURNED-URL to killring for easy pasting
(message "Added %S to kill ring." returned-url)) (when webpaste/add-to-killring
(kill-new returned-url)
(message "Added %S to kill ring." returned-url)))

Loading…
Cancel
Save