Install

Emacs Lisp Package Archive

The auto-install code below will download package.el and the url package (if you need it), will edit your .emacs to initialize the package manager on future invocations of Emacs, and will finally initialize the package manager in your currently running Emacs. There are two sets of instructions, depending on what version of Emacs you are using.

If you are using Emacs 22, you already have the needed url package, and you can eval this code:

  (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))))
  
If you don't know what "eval" means, it means that you should copy this into your *scratch* buffer, move your cursor just after the final closing paren, and type C-j.

If you are running Emacs 21, you will need the external wget utility. Eval this code:

  (let ((buffer (get-buffer-create (generate-new-buffer-name " *Download*"))))
    (save-excursion
      (set-buffer buffer)
      (shell-command "wget -q -O- http://tromey.com/elpa/package-install.el"
		     (current-buffer))
      (eval-region (point-min) (point-max))
      (kill-buffer (current-buffer))))
  

If you have Emacs 21 but do not have wget, then you are on your own for now, sorry.

Once you have installed the package manager, type M-x package-list-packages. Type r in the package menu buffer to update the list of packages available from the server. If you want a particular package, type i next to its name to mark it for installation, and then x to download and install it.

Note that for some packages, package.el requires you to have an external tar program.