All Projects → etu → Webpaste.el

etu / Webpaste.el

Licence: gpl-3.0
webpaste.el can paste whole buffers or parts of buffers to several pastebin-like services and supports failover if one service fails.

Programming Languages

elisp
30 projects

Projects that are alternatives of or similar to Webpaste.el

Psc Ide Emacs
Emacs integration for PureScript's psc-ide tool.
Stars: ✭ 130 (+94.03%)
Mutual labels:  emacs, emacs-mode
Live Py Plugin
Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
Stars: ✭ 222 (+231.34%)
Mutual labels:  emacs, emacs-mode
Emacs Solidity
The official solidity-mode for EMACS
Stars: ✭ 120 (+79.1%)
Mutual labels:  emacs, emacs-mode
Jq Mode
Emacs major mode for editing jq queries.
Stars: ✭ 70 (+4.48%)
Mutual labels:  emacs, emacs-mode
Deft
Deft for Emacs
Stars: ✭ 521 (+677.61%)
Mutual labels:  emacs, emacs-mode
Zoom
Fixed and automatic balanced window layout for Emacs
Stars: ✭ 252 (+276.12%)
Mutual labels:  emacs, emacs-mode
Org Msg
OrgMsg is a GNU/Emacs global minor mode mixing up Org mode and Message mode to compose and reply to emails in a Outlook HTML friendly style.
Stars: ✭ 153 (+128.36%)
Mutual labels:  emacs, emacs-mode
Clj Refactor.el
A collection of Clojure refactoring functions for Emacs
Stars: ✭ 694 (+935.82%)
Mutual labels:  emacs, emacs-mode
Writegood Mode
Minor mode for Emacs to improve English writing
Stars: ✭ 369 (+450.75%)
Mutual labels:  emacs, emacs-mode
Swift Mode
Emacs support for Apple's Swift programming language.
Stars: ✭ 308 (+359.7%)
Mutual labels:  emacs, emacs-mode
Nyan Mode
Nyan Cat for Emacs! Nyanyanyanyanyanyanyanyanyan!
Stars: ✭ 590 (+780.6%)
Mutual labels:  emacs, emacs-mode
Fingers.el
Modal editing minor mode for Emacs
Stars: ✭ 51 (-23.88%)
Mutual labels:  emacs, emacs-mode
.dot Org Files
Dotfiles, Emacs + Org-mode with babel and Literate programming.
Stars: ✭ 57 (-14.93%)
Mutual labels:  emacs
.emacs.d
一个快速且实用的 Emacs 配置
Stars: ✭ 63 (-5.97%)
Mutual labels:  emacs
Emacs Document
translate emacs documents to Chinese for convenient reference
Stars: ✭ 1,085 (+1519.4%)
Mutual labels:  emacs
.emacs.d
My emacs config
Stars: ✭ 56 (-16.42%)
Mutual labels:  emacs
Org Web
org-mode on the web, built with React, optimized for mobile, synced with Dropbox and Google Drive
Stars: ✭ 1,133 (+1591.04%)
Mutual labels:  emacs
Nekobin
Elegant and open-source pastebin service
Stars: ✭ 61 (-8.96%)
Mutual labels:  pastebin
Org Tfl
Transport for London meets Emacs Orgmode
Stars: ✭ 55 (-17.91%)
Mutual labels:  emacs
Lsp Javascript
Stars: ✭ 55 (-17.91%)
Mutual labels:  emacs

[[https://www.gnu.org/licenses/gpl-3.0.txt][https://img.shields.io/badge/license-GPL_3-green.svg]] [[https://melpa.org/#/webpaste][https://melpa.org/packages/webpaste-badge.svg]] [[https://stable.melpa.org/#/webpaste][https://stable.melpa.org/packages/webpaste-badge.svg]] [[https://github.com/etu/webpaste.el/actions?query=workflow%3A%22Unit+tests%22][https://github.com/etu/webpaste.el/workflows/Unit%20tests/badge.svg]] [[https://github.com/etu/webpaste.el/actions?query=workflow%3A%22Integration+tests%22][https://github.com/etu/webpaste.el/workflows/Integration%20tests/badge.svg]] [[https://coveralls.io/github/etu/webpaste.el?branch=master][https://coveralls.io/repos/github/etu/webpaste.el/badge.svg?branch=master]]

  • Webpaste.el -- Paste text to pastebin-like services 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 preferred services can easily be configured.

  • Table of Contents :TOC_3_gh:

  • [[#webpasteel----paste-text-to-pastebin-like-services][Webpaste.el -- Paste text to pastebin-like services]]
  • [[#installation][Installation]]
    • [[#the-lazy-way-using-use-package][The lazy way (Using use-package)]]
  • [[#configuration][Configuration]]
    • [[#choosing-providers--provider-priority][Choosing providers / provider priority]]
    • [[#only-paste-plaintext-pastes][Only paste plaintext pastes]]
    • [[#confirm-pasting-with-a-yesno-confirmation-before-pasting][Confirm pasting with a yes/no confirmation before pasting]]
    • [[#max-retries-on-failure][Max retries on failure]]
    • [[#view-recently-created-pastes][View recently created pastes]]
      • [[#send-the-returned-url-to-the-killring][Send the returned URL to the killring]]
      • [[#copy-url-to-the-clipboard][Copy URL to the clipboard]]
      • [[#open-the-recently-created-paste-in-the-browser][Open the recently created paste in the browser]]
      • [[#use-a-custom-hook][Use a custom hook]]
    • [[#custom-providers][Custom providers]]
  • [[#providers-to-implement-710][Providers to implement]]
  • Installation ** The lazy way (Using [[https://github.com/jwiegley/use-package][use-package]]) This requires that you have [[https://github.com/jwiegley/use-package][use-package]] set up. But it's in my opinion the easiest way to install and configure packages.

#+BEGIN_SRC emacs-lisp (use-package webpaste :ensure t :bind (("C-c C-p C-b" . webpaste-paste-buffer) ("C-c C-p C-r" . webpaste-paste-region) ("C-c C-p C-p" . webpaste-paste-buffer-or-region))) #+END_SRC

  • 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: #+begin_src emacs-lisp ;; Choosing githup gist only (setq webpaste-provider-priority '("gist.github.com"))

;; Choosing ix.io as first provider and dpaste.org as second (setq webpaste-provider-priority '("ix.io" "dpaste.org"))

;; Choosing 1) ix.io, 2) dpaste.org, 3) dpaste.com (setq webpaste-provider-priority '("ix.io" "dpaste.org" "dpaste.com"))

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

This can be added to the =:config= section of use-package: #+BEGIN_SRC emacs-lisp (use-package webpaste :ensure t :bind (("C-c C-p C-b" . webpaste-paste-buffer) ("C-c C-p C-r" . webpaste-paste-region) ("C-c C-p C-p" . webpaste-paste-buffer-or-region)) :config (progn (setq webpaste-provider-priority '("ix.io" "dpaste.org")))) #+END_SRC

** Only paste plaintext pastes If you don't want language detection you can define the following parameter that will tell the language detection to not check what language it is and not return anything to make it fallback to plaintext.

Example: #+begin_src emacs-lisp ;; Only paste raw pastes (setq webpaste-paste-raw-text t) #+end_src

** 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: #+begin_src emacs-lisp ;; Require confirmation before doing paste (setq webpaste-paste-confirmation t) #+end_src

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

** Max retries on failure To prevent infinite loops of retries there's an option named =webpaste-max-retries=, it's default value is =10=. Webpaste shouldn't try more than 10 times against remote services.

This can be changed: #+begin_src emacs-lisp ;; Do maximum 13 retries instead of standard 10 (setq webpaste-max-retries 13) #+end_src

** View recently created pastes Webpaste gives you several options to view your successful paste.

*** Send the returned URL to the killring This is webpaste's default behavior. After a successful 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 ;; To build your own hook to use simpleclip, you could do like this: (add-hook 'webpaste-return-url-hook (lambda (url) (message "Copied URL to clipboard: %S" url) (simpleclip-set-contents url))) #+END_SRC

*** 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: #+begin_src emacs-lisp ;; 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.

*** 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.

#+begin_src emacs-lisp ;; 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) (message "Opened URL in browser: %S" url) (browse-url-generic url)))

;; Simple hook to replicate the `webpaste-copy-to-clipboard' option (add-hook 'webpaste-return-url-hook 'simpleclip-set-contents) #+end_src

** Custom providers The example of one of the simplest providers possible to write: #+begin_src emacs-lisp (require 'webpaste) (add-to-list 'webpaste-providers-alist '("example.com" :uri "https://example.com/" :post-field "content" :success-lambda webpaste-providers-success-location-header)) #+end_src

Options available are the options used in webpaste--provider. These docs are available within emacs documentation. To read this you need to require webpaste first and then just read the documentation by running this: #+begin_src emacs-lisp (require 'webpaste) (describe-function 'webpaste--provider) #+end_src

  • TODO Providers to implement [8/15]
  • [ ] clbin.com
  • [ ] 0x0.st
  • [X] ix.io
  • [X] paste.rs
  • [X] dpaste.com
  • [X] dpaste.org
  • [X] gist.github.com
  • [X] paste.pound-python.org
  • [X] paste.mozilla.org
  • [X] bpa.st
  • [ ] paste.debian.net
  • [ ] bpaste.net
  • [ ] eval.in
  • [ ] ptpb.pw (RIP due to [[https://github.com/ptpb/pb/issues/245][ptpb/pb#245]] & [[https://github.com/ptpb/pb/issues/240][ptpb/pb#240]])
  • [ ] sprunge.us (removed due to [[https://github.com/rupa/sprunge/issues/45][sprunge#45]] that yields 500s)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].