Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install pastemacs

How to install pastemacs

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install pastemacs
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1.2 Available View build log
Mac OS X (10.5+)
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1.2 Available View build log
Linux (32-bit)
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1.2 Available View build log
Linux (64-bit)
0.3 Available View build log
0.2.1 Available View build log
0.2 Available View build log
0.1.2 Available View build log
Lastest release
version 0.3 on Jan 5th, 2011


pastemacs allows to create and retrieve pastes from http://paste.pocoo.org directly from Emacs. It is available under the terms of the GNU GPL 2 (see COPYING).


You will need at least Python 2.6 (earlier versions may work, but are not tested, Python 3 is not supported). pastemacs itself is available in the Python package index and can simply be installed using pip or easy_install:

pip install pastemacs
# or
easy_install pastemacs

This installs pastemacs and its dependency lodgeitlib. Alternatively you can just clone the Git repository and install manually:

git clone git://github.com/lunaryorn/pastemacs.git
cd pastemacs
python setup.py install

In this case you need to manually install lodgeitlib before.

Moreover you need a working installation of Pymacs. This should be available in the package repositories of your distribution. If not, or if you are on Windows, refer to the Pymacs documentation for installation instructions.


In order to use pastemacs, just add the following two lines to your Emacs configuration file:

(pymacs-load "pastemacs" "paste-")

The second line only enables the GUI menu to create and fetch pastes, and is not strictly required. Now all pastemacs commands are available. You can use them either through the menu (if enabled) or by executing them directly using M-x. pastemacs does not register any shortcuts for its commands, so if you want some, you have to register them for yourself (e.g. by using global-set-key).

Take a look at the configuration, the author of pastemacs uses, if you want to see an example.

Creating pastes

The command paste-new creates a new paste. If transient mark mode is enabled and the mark is active, it pastes the contents of the region, otherwise it pastes the complete buffer contents.

The command prompts for a (programming) language, in which the paste is written. This is used for syntax highlighting in the pastebin web interface. The list of available languages is fetched from the server, once you create your first paste, and available as completion list for the language prompt. You cannot enter a language, which isn't supported, so if the language isn't available, choose the default "text".


pastemacs tries to derive a language from the name of the major mode and sets it as default while prompting for a language, but this isn't really clever, and will often fail. So be sure to check the language, if you want syntax highlighting for your paste.

By default the URL of the new paste will only be displayed in the minibuffer and in the *Messages* buffer. To automatically put the url into the kill ring, set the variable paste-kill-url to a non-nil value in your emacs configuration.

Alternatively new pastes can automatically be opened in your favourite web browser by setting paste-show-in-browser to a non-nil value in your emacs configuration.

Both variables are available in customization.

Retrieving pastes

To retrieve a paste, use paste-fetch. It fetches a paste and inserts its contents at the point in the current buffer.

The commands prompts for a paste to retrieve. You can either enter a complete paste URL, or just a paste ID. Empty input is also allowed, and stands for the last paste.


Simply visit the customization group pastebin.

Issues, Feedback and Development

All development happens on Github.

Please report issues, proposals or enhancements to the issue tracker. Please provide as much information as possible when reporting issues.

Feel free to clone the repository, add you own modifications and send a pull requests. Enhancements and new features are always appreciated :)

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:3

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.