Friday, 15 May 2009

Package Management in Emacs

Emacs Lisp Package Archive is a add-on manager for Emacs. Hadn't seen it before. It's incredibly simple to install.


(let ((buffer (url-retrieve-synchronously
"http://tromey.com/elpa/package-install.el")))
(save-excursion
(set-buffer buffer)
(goto-char (point-min))
(re-search-forward "^$" nil 'move)
(eval-region (point) (point-max))
(kill-buffer (current-buffer))))


Evaluate this in Emacs (v.22 or greater), default key is Ctrl+J. This'll retrieve the el file and then evaluate it. Restart (or re-evaluate your .emacs) file and then M-x RET package-list will give you a list of available packages. M-x RET package-install RET name of package will download and install the package.

I used this to get the highlight-parentheses package (useful when you program in Lisp!). Other cool add-ons include: