More concise usage section in README (see #1624)

This commit is contained in:
Steve Purcell 2014-04-06 11:20:05 +01:00
parent 06177c4dee
commit 212d3b3ca9

View file

@ -29,39 +29,32 @@ details.
## Usage ## Usage
To use the MELPA repository, add it to `package-archives` after To use the MELPA repository, you'll need an Emacs with
`(require 'package)` and before the call to `package-initialize` in `package.el`. Emacs 24 has `package.el` bundled with it, and there's
your `init.el` file. also a
[version you can use with Emacs 23](http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el).
```lisp Enable installation of packages from MELPA by adding an entry to
(add-to-list 'package-archives `package-archives` after `(require 'package)` and before the call to
'("melpa" . "http://melpa.milkbox.net/packages/") t) `package-initialize` in your `init.el` file:
```
In Emacs < 24, you'll also need to explicitly include the GNU ELPA
archive, which provides important compatibility libraries like
`cl-lib`:
```lisp
(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
```
A complete minimal example for MELPA,
```lisp ```lisp
(require 'package) (require 'package)
(add-to-list 'package-archives (add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t) '("melpa" . "http://melpa.milkbox.net/packages/") t)
(when (< emacs-major-version 24) (when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) (package-initialize)
``` ```
MELPA packages will always have higher versions than those from other Then just use `M-x package-list-packages` to browse and install
archives like Marmalade, so if you decide you need non-MELPA versions packages from MELPA and elsewhere.
of specific packages for some reason, extra configuration will be
required: Note that MELPA packages will always have higher versions than those
from other archives like Marmalade, so if you decide you need
non-MELPA versions of specific packages for some reason, extra
configuration will be required:
If your Emacs has the variable `package-pinned-packages`, you can If your Emacs has the variable `package-pinned-packages`, you can
customize or modify that variable as needed. Otherwise, use the customize or modify that variable as needed. Otherwise, use the