I’ve been meaning to install ELPA for a long time but never got around to it. Then Emacs 24 was on the horizon and I thought, “Why bother going through the pain of installing it when it will be included in Emacs 24 anyway?” Now, Xah Lee has shamed me into it by posting his Guide on the Emacs Package System.
It is astounding how easy the installation is. Simply cut a bit of Elisp from Lee’s page, paste it into an Emacs buffer, evaluate the buffer and you’re done. The Elisp that you paste retrieves the ELPA installer and executes it. The installer makes an elpa
directory in ~/.emacs.d/
, populates it with the necessary files including package.el
, and adds some Elisp to your .emacs
or init.el
file to load the packages you install when Emacs starts.
Lee includes a section on what to do when you upgrade to Emacs 24. It mostly involves removing the ELPA code from your .emacs
, deleting the ~/.emacs.d/elpa
subdirectory, and reinstalling the packages you had loaded.
I did run into one problem. By default, ELPA uses the tromey.com/elpa
package server but I wanted to use the more extensive Marmalade server. Lee has instructions on how to do that. You just add
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
to your .emacs
or init.el
file and execute it. Unfortunately, the package-archives
variable doesn’t exist in the package.el
that got downloaded. The Marmalade site (Lee has a link to it) points to a slightly never version that does have it so I just installed that instead. No problems so far and I saved the old version in case there are any.
One of the nice things about ELPA is that it stores everything in your ~/.emacs.d/elpa
subdirectory so it’s easy to keep my machines in sync since ~/.emacs.d
is under Git. All in all, a big win for me.