Added support to open created pastes in browser

This fixes #4.
master
Elis Axelsson 9 years ago
parent 01440169d1
commit 7bd2cec67b
No known key found for this signature in database
GPG Key ID: D57EFA625C9A925F
  1. 14
      README.org
  2. 11
      webpaste.el

@ -68,6 +68,20 @@ Example:
Can also be put in the =:config= section of =use-package= the same way as the
provider definitions above.
*** Open recently created pastes in browser
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
non-nil value.
Example:
#+begin_src emacs-lisp :tangle yes
;; Open recently created pastes in an external browser
(setq webpaste/open-in-browser t)
#+end_src
Can also be put in the =:config= section of =use-package= the same way as the
provider definitions above.
** TODO Providers to implement [6/10]
- [X] ptpb.pw
- [X] ix.io

@ -58,6 +58,13 @@ default to all providers in order defined in ‘webpaste-providers’ list."
"Prompt for a yes/no confirmation before attempting to paste a region or buffer."
:group 'webpaste)
(defcustom webpaste/open-in-browser nil
"Open recently created pastes in a browser.
This uses `browse-url-generic' to open URLs."
:group 'webpaste)
(defvar webpaste/tested-providers ()
@ -369,6 +376,10 @@ return it to the user."
;; Reset tested providers after successful paste
(setq webpaste/tested-providers nil)
;; If the user want to open the link in an external browser, do so.
(when webpaste/open-in-browser
(browse-url-generic returned-url))
;; Add RETURNED-URL to killring for easy pasting
(kill-new returned-url)

Loading…
Cancel
Save