Next: , Previous: , Up: Top   [Index]


3 Getting Started

3.1 Quick Installation

Make sure you have this in your init file (usually ‘~/.emacs‘). If you already have custom-set-variables, merge its contents:

(require 'package)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-archives
   (quote
    (("gnu" . "http://elpa.gnu.org/packages/")
     ("melpa-stable" . "http://stable.melpa.org/packages/")))))

Then run emacs, and evaluate:

M-x package-refresh-contents

and then follow by

M-x package-install RET haskell-mode

Voila! haskell-mode is installed! You should be able to edit Haskell source code in color now.

3.2 Installation - more information

haskell-mode supports GNU Emacs versions 23, 24 and upcoming 25 (snapshot).

haskell-mode is available from melpa-stable (releases) and melpa (git snapshots).

Other means of obtaining ‘haskell-mode‘ include el-get, Emacs Prelude) and Debian package.

Emacs23 requires an the use of cl-lib. cl-lib.el can be found in the tests/compat directory. Copy cl-lib.el to your emacs directory, e.g. ~/.emacs.d directory and put

(add-to-list 'load-path "~/.emacs.d/")
(require 'cl-lib)

in your .emacs file.

3.3 Customizing

Most of Haskell Mode’s settings are configurable via customizable variables (see (emacs)Easy Customization, for details). You can use

M-x customize-group RET haskell to browse the haskell customization sub-tree.

One of the important setting you should customize is the haskell-mode-hook variable (see (emacs)Hooks) which gets run right after the haskell-mode major mode is initialized for a buffer. You can customize haskell-mode-hook by M-x customize-variable RET haskell-mode-hook.


Next: , Previous: , Up: Top   [Index]