pastebin is an Emacs interface to

You can use it to send little snippets of code (or whole buffers) to the web for sharing with others.

pastebin allows sending of regions or whole buffers and let’s you specify the virtual host for pastebin. So you can send code to or

The code is downloadable from the wiki here: pastebin.el

Apparently this version is broken as reported by RyanDavis: pastebin-version-path is undefined. - IvanKorotkov

Fixed now. Thanks. - NicFerrier

The code is also on a github repo here.

A more generic solution, webpaste that has been updated more recently (in last 25 days 04/04/2019) github repo

There are two versions of pastebin’s code. One is the main site available on the Internet, the other is an earlier downloadable version. The pastebin elisp library supports both of these via configuration which allows the version supported by a particular domain to be specified.

IvanKorotkov kindly updated this code to match the new API and also added customization group added allowing to set default prefix (subdomain) and modes-alist.

He keeps his version here: pastebin.el

That version varies widely from the one on here and it looks like the one on here is newer. Unfortunately, the one on here seems more than a little shortsighted. To use subdomains you used to be able to customize the following:

    '(pastebin-default-subdomain "zenspider")

Now, you must do all of:

    '(pastebin-default-domain "")
    '(pastebin-domain-versions (quote (("" "/api_public.php")
                                       ("" "/api_public.php")
                                       ("" "/pastebin.php"))))

The subdomain code was much more straightforward.

I just found another bug. Using it with subdomains now returns urls like:


asvil updated IvanKorotkov’s code to match the new API.

New pastebin.el version here: newpastebin.el

I’ve change newpastebin.el, if no name is provided to pastebin function, buffer-name is used. Also fix the check for region. Here is buffer-name-pastebin.el

Editing: I create a new version of pastebin.el, supporting fetch and deletion, here is: gkos/emacs-pastebin


Get in touch with me via github? I’d be quite happy to assign you the repo for pastebin.el

You access your API-key from a text file rather than inserting it directly in your emacs init-file. See the Comments page. – ColinBaxter