Table of Contents
There are two well known Emacs package archives: GNU ELPA and MELPA (well, there’s also Marmalade). The user option
package-archives by default includes GNU ELPA but not MELPA. MELPA packages are usually coming right from Github, and they aren’t stable releases. Say you don’t want MELPA in your
package-archives list because you don’t want to get unstable updates from MELPA. What to do then if you want just one or two packages from MELPA?
2. installing or updating one package from MELPA
Let’s take SLIME as an example, which is a package for making working with general Lisp code as comfortable as working with Emacs Lisp code. (Actually, you might want to use quicklisp instead for installing SLIME, but that’s another story.)
SLIME is available on the Marmalade archive but as of now, the version on that archive is
20100404.1 which is very old and may be buggy. Let’s install SLIME from the MELPA archive instead. Yes the MELPA one can be buggy too, but if you submit a bug report and if the bug gets fixed, the fix will come to the MELPA one first.
This is how I installed SLIME:
- If you already have SLIME, uninstall it first.
- Check if it’s uninstalled successfully by restarting Emacs and then doing
M-x locate-library RET slime RET
- Begin a clean session of Emacs by running:
and then in that session, evaluate the following code:
(require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (list-packages)
which will show the package list. You can find SLIME from the giant list by passing
^ slime(one caret and two spaces followed by the word slime) to
M-x occur. Install SLIME from there.
If you want to update SLIME later, you repeat that again.
3. checking if the package is installed correctly
- Restart Emacs
M-x locate-library RET slime RETto see the full path of
slime.elcand see if there is anything wrong (such as the version number in the directory name being too old)