ELPA makes the installation of Emacs packages very easy! The description below is for Emacs 23, and I use Ctrl+ and Alt+ rather than the classic C- and M-.

Install ELPA

In a buffer, paste the following:

(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))))

and evaluate with Ctrl+J. This automatically downloads ELPA and installs it.

Run ELPA

Type Alt+X package-list-packages, this opens a buffer with a list of packages that can be installed. Here are the commands:

  • n: go to next line,
  • i: select package for installation,
  • u: de-select package,
  • r: refresh package list,
  • x: actually install all the marked packages,
  • h: help,
  • q: close ELPA.

Example

To install ruby-mode, do Ctrl+S ruby-mode and press Enter. Select package for installation with i , and do the installation with x.