Skip to content

Update instructions in README.md. #560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 68 additions & 127 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,176 +1,117 @@
Haskell Mode for Emacs
----------------------
======================

[![Build Status](https://travis-ci.org/haskell/haskell-mode.svg?branch=master)](https://travis-ci.org/haskell/haskell-mode)
[![Melpa Status](http://melpa.org/packages/haskell-mode-badge.svg)](http://melpa.org/#/haskell-mode)
[![Melpa Stable Status](http://stable.melpa.org/packages/haskell-mode-badge.svg)](http://stable.melpa.org/#/haskell-mode)

This is the Haskell mode package for Emacs.
This is an Emacs mode for editing, debugging, and developing Haskell programs.

Please see
[the online haskell-mode manual](https://github.com/haskell/haskell-mode/wiki)
for setup and use guide.

To report problems or suggestions, please
[open an issue](https://github.com/haskell/haskell-mode/issues?state=open)
in the issue tracker.

Below is a brief setup guide.
## Installation

Quick Emacs rundown
--------------------
`haskell-mode` is best installed as a package.

When Emacs is started up, it normally loads the
[Emacs initialization file](http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html)
usually called `~/.emacs`, `~/.emacs.el`, or `~/.emacs.d/init.el`;
with `~` standing for for your home directory. This file should
contain all of your personal customisations written as a series of
Emacs Lisp commands. In the following sections, this file will simply
be referred to as the `.emacs` file.
To install `haskell-mode` you need to add a package archive repository that distributes
`haskell-mode`. Execute

Installation
------------
```
M-x customize-option RET package-archives
```

GNU Emacs version 23 or later is officially supported. It may work
with other Emacsen, but we don't have the resources to support other
versions.
and add

There are many ways to install `haskell-mode`. The following sections
describe the most common ones; pick the one that you're most
comfortable with.
Archive name: melpa-stable
URL or directory name: http://stable.melpa.org/packages/

### `package.el`-based Installation
Fetch list of packages with

*This is the recommended way*
M-x package-refresh-contents

`package.el` is the new
[built-in package manager](http://www.emacswiki.org/emacs/ELPA#toc4)
included in Emacs 24.x. On Emacs 23.x you will need to download
[`package.el`](http://bit.ly/pkg-el23) yourself and place `package.el`
somewhere in your
[`load-path`](http://www.emacswiki.org/emacs/LoadPath).
and then follow by

#### Marmalade
M-x package-install RET haskell-mode

**Stable releases** of `haskell-mode` are available on
[Marmalade](http://marmalade-repo.org/packages/haskell-mode).
Voila! `haskell-mode` is installed! You should be able to edit Haskell
source code in color now.

If you're not already using Marmalade, add the following snippet to
your `.emacs` and evaluate it with `M-x eval-buffer`:
You need to enable indentation as this does not happen automatically
currently. Add this line to your ~/.emacs file:

```el
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
(add-hook 'haskell-mode-hook 'haskell-indentation-mode)

```

Refresh the package index by `M-x package-refresh-contents` and install
`haskell-mode` via `M-x package-install [RET] haskell-mode`.
`Haskell-mode` has much much much more to offer but the above should get you
going!

Alternatively, you can also download the `.tar` file via the
_Download_ link at http://marmalade-repo.org/packages/haskell-mode and
install the package `.tar`-file via `M-x package-install-file`

Note that in this case you will also need to have a sufficiently
recent version of `cl-lib.el`, upon which `haskell-mode` depends.
This is bundled with Emacs 24.3 and later, and a backported version
for use with older Emacs versions can be obtained from
[GNU ELPA](http://elpa.gnu.org/packages/cl-lib.html).
## Advanced configuration

#### MELPA
For setup instructions, please consult the integrated `haskell-mode`
[Info](https://www.gnu.org/software/texinfo/manual/info/info.html)
manual which can be accessed after installation via `M-x
info-display-manual [RET] haskell-mode`. Alternatively, you can also
direct your browser to the
[the online haskell-mode manual](https://github.com/haskell/haskell-mode/wiki)
for setup and user guide.

**Development snapshots** can be installed via the
[MELPA](http://melpa.org) community maintained repository.

For MELPA the code you need to add is:
## Installation - more information

```lisp
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
```
`haskell-mode` supports GNU Emacs versions 23, 24 and upcoming 25
(snapshot).

Refresh the package index by `M-x package-refresh-contents` and install
`haskell-mode` via `M-x package-install [RET] haskell-mode`.
`haskell-mode` is available from [melpa-stable](http://http://stable.melpa.org) (releases) and [melpa](http://melpa.org)
(git snapshots).

### el-get based Installation
Other means of obtaining `haskell-mode` include
[el-get](https://github.com/dimitri/el-get),
[Marmalade](http://marmalade-repo.org/packages/haskell-mode),
[Emacs Prelude](https://github.com/bbatsov/prelude) and [Debian package](https://packages.debian.org/search?keywords=haskell-mode).

[el-get](https://github.com/dimitri/el-get) is another popular package manager for Emacs.
If you're an el-get user just do `M-x el-get-install` to get `haskell-mode` installed.

### Emacs Prelude
## Installation from git repository

`haskell-mode` is bundled with
[Emacs Prelude](https://github.com/bbatsov/prelude). If you're a
Prelude user you can start using it right away.
Running `haskell-mode` directly from sources is easy but
requires a little preparation:

### Debian
- `git clone https://github.com/haskell/haskell-mode.git` into a
suitable directory, e.g. `~/lib/emacs/haskell-mode/` where `~`
stands for your home directory.

If you are using Debian, you can install an older version (e.g. Wheezy
ships with version 2.8.0) of `haskell-mode` with a command like:
- Assuming you have unpacked the various haskell-mode modules
(`haskell-mode.el` and the rest) in the directory
`~/lib/emacs/haskell-mode/`, you need to generate various files, the
autoloads file (`haskell-mode-autoloads.el`) is one among
them. Invoke:

```bash
$ apt-get install haskell-mode
make EMACS=/path/to/your/emacs
```

### Installation from Git

*This installation method requires more work and recommended for
haskell-mode developers/contributors only as it allows to load
haskell-mode directly from the checked out Git working copy. If you
just want to use bleeding edge versions of haskell-mode please use
the MELPA installation method described above.*
and then adding the following command to your `.emacs`:

- `git clone https://github.com/haskell/haskell-mode.git` into a
suitable directory, e.g. `~/lib/emacs/haskell-mode/` where `~`
stands for your home directory.

- Assuming you have unpacked the various haskell-mode modules
(`haskell-mode.el` and the rest) in the directory
`~/lib/emacs/haskell-mode/`, you need generate the autoloads file
(`haskell-mode-autoloads.el`) by either

- Invoking `make haskell-mode-autoloads.el`, or `make all` (use
this to perform byte-compilation and Info manual generation)

- From inside Emacs, `M-x update-directory-autoloads` and answering the question for
the folder with `~/lib/emacs/haskell-mode/` and the question for the output-file with
`~/lib/emacs/haskell-mode/haskell-mode-autoloads.el`

and then adding the following command to your `.emacs`:
```el
(add-to-list 'load-path "~/lib/emacs/haskell-mode/")
(require 'haskell-mode-autoloads)
(add-to-list 'Info-default-directory-list "~/lib/emacs/haskell-mode/")
```

```el
(add-to-list 'load-path "~/lib/emacs/haskell-mode/")
(require 'haskell-mode-autoloads)
(add-to-list 'Info-default-directory-list "~/lib/emacs/haskell-mode/")
```
## Contributing

- After updating your haskell-mode working directory, you need to
re-run `make all` or `M-x update-directory-autoloads`.
If you followed the above you are just a couple of steps away from
contributing to `haskell-mode`.

Basic Configuration
-------------------
`haskell-mode` is activelly seeking contributions from users of
`haskell-mode`. For more information have a look at
[the wiki page on contributing](https://github.com/haskell/haskell-mode/wiki/Contributing).

For setup instructions, please consult the new integrated haskell-mode
[Info](https://www.gnu.org/software/texinfo/manual/info/info.html)
manual which can be accessed after installation via
`M-x info-display-manual [RET] haskell-mode`.
Alternatively, you can also direct your browser to the
[the online haskell-mode manual](https://github.com/haskell/haskell-mode/wiki)
for setup and use guide.

Support
-------
## Getting in contact

- [Mailing list](http://projects.haskell.org/cgi-bin/mailman/listinfo/haskellmode-emacs)
- [Github homepage](https://github.com/haskell/haskell-mode)
- IRC: #haskell-emacs on irc.freenode.net

Contributing
------------

For submitting pull requests, please see the wiki
[page on contributing](https://github.com/haskell/haskell-mode/wiki/Contributing). You
don't have to follow this guide, but please make sure your pull
requests are at least properly rebased and up to date.
Have fun!