You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Elis Axelsson 26a8035f5e
Switched to simpler provider definitions where we don't store lambdas in the alist
9 years ago
tests Switched to simpler provider definitions where we don't store lambdas in the alist 9 years ago
.gitignore Added Cask file 9 years ago
.travis.yml Added printing of travis event type 9 years ago
CONTRIBUTING.org Added more details for contributing 9 years ago
Cask Switched from ert to buttercup for testing 9 years ago
LICENSE Added LICENSE 10 years ago
Makefile Added stuff to Makefile to run integration tests 9 years ago
README.org Remove :tangle yes from README 9 years ago
webpaste.el Switched to simpler provider definitions where we don't store lambdas in the alist 9 years ago

README.org

Webpaste.el – Paste text to pastebin-like services

<img src=" title="https://img.shields.io/badge/license-GPL_3-green.svg" /> <img src=" title="https://melpa.org/packages/webpaste-badge.svg" /> <img src=" title="https://stable.melpa.org/packages/webpaste-badge.svg" /> https://travis-ci.org/etu/webpaste.el.svg?branch=master">https://travis-ci.org/etu/webpaste.el.svg?branch=master https://coveralls.io/repos/github/etu/webpaste.el/badge.svg?branch=master">https://coveralls.io/repos/github/etu/webpaste.el/badge.svg?branch=master

This mode allows to paste whole buffers or parts of buffers to pastebin-like services. It supports more than one service and will failover if one service fails. More services can easily be added over time and prefered services can easily be configured.

Installation

The lazy way (Using use-package)

This requires that you have use-package set up. But it's in my opinion the easiest way to install and configure packages.

  (use-package webpaste
    :ensure t
    :bind (("C-c C-p C-b" . webpaste-paste-buffer)
           ("C-c C-p C-r" . webpaste-paste-region)))

Configuration

Choosing providers / provider priority

To select which providers to use in which order you need to set the variable webpaste-provider-priority which is a list of strings containing the providers names.

Examples:

  ;; Choosing githup gist only
  (setq webpaste-provider-priority '("gist.github.com"))

  ;; Choosing ptpb.pw as first provider and dpaste.de as second
  (setq webpaste-provider-priority '("ptpb.pw" "dpaste.de"))

  ;; Choosing 1) ptpb.pw, 2) dpaste.de, 3) ix.io
  (setq webpaste-provider-priority '("ptpb.pw" "dpaste.de" "ix.io"))

  ;; You can always append this list as much as you like, and which providers
  ;; that exists is documented below in the readme.

This can be added to the :config section of use-package:

  (use-package webpaste
    :ensure t
    :bind (("C-c C-p C-b" . webpaste-paste-buffer)
           ("C-c C-p C-r" . webpaste-paste-region))
    :config
    (progn
      (setq webpaste-provider-priority '("ptpb.pw" "dpaste.de"))))

Confirm pasting with a yes/no confirmation before pasting

To enable a confirmation dialog to always pop up and require you to confirm pasting before text is actually sent to a paste-provider you just need to set the variable webpaste-paste-confirmation to a value that is non-nil.

Example:

  ;; Require confirmation before doing paste
  (setq webpaste-paste-confirmation t)

Can also be put in the :config section of use-package the same way as the provider definitions above.

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

(setq webpaste-add-to-killring nil)
Copy URL to the clipboard

If you have simpleclip installed, you can copy the returned URL to the clipboard. You can enable this with

(setq webpaste-copy-to-clipboard t)
Open the recently created paste in the 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:

  ;; Open recently created pastes in an external browser
  (setq webpaste-open-in-browser t)

Can also be put in the :config section of use-package the same way as the provider definitions above.

Use a custom hook

You can define a custom hook to send your URL's to when returning them from the paste provider. This is just like regular hooks for major modes etc. You can have several hooks as well if you want it to do several custom things.

  ;; Simple hook to just message the URL, this is more or less the default
  ;; already. But if you disable the default and still want a message, this
  ;; would work fine.
  (add-hook 'webpaste-return-url-hook 'message)

  ;; To build your own send-to-browser hook, you could do like this:
  (add-hook 'webpaste-return-url-hook
            (lambda (url) (browse-url-generic url)))

TODO Providers to implement [7/10]

  • ptpb.pw
  • ix.io
  • dpaste.com
  • sprunge.us
  • dpaste.de
  • gist.github.com
  • paste.pound-python.org
  • paste.debian.net
  • bpaste.net
  • eval.in