Next: Editing Haskell Code, Previous: Getting Help and Reporting Bugs, Up: Top [Index]
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.
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.
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: Editing Haskell Code, Previous: Getting Help and Reporting Bugs, Up: Top [Index]