1

I'm following these instructions to install haskell-mode on Ubuntu 12. However when I get to the point of typing M-x customize-option RET pac then Emacs says: no match! All the customizable variables are shown in the picture below.

Any idea what is going wrong?

enter image description here

jhegedus
  • 20,244
  • 16
  • 99
  • 167

2 Answers2

2

Go to your init.el file (~/.emacs.d/init.el) and place this there:

(setq package-archives
      '(("gnu"         . "http://elpa.gnu.org/packages/")
        ("original"    . "http://tromey.com/elpa/")
        ("org"         . "http://orgmode.org/elpa/")
        ("marmalade"   . "http://marmalade-repo.org/packages/")
        ("melpa" . "http://melpa.milkbox.net/packages/")))

(package-initialize)

And then do M-x package-refresh-contents and you can install haskell-mode from there. Also make sure that your Emacs version is >= 24 since package.el is bundled with only higher version. If you are using older version, you may have to manually install that package.

Sibi
  • 47,472
  • 16
  • 95
  • 163
0

This requires emacs24 or newer.

First, install MELPA:

sudo emacs /etc/emacs/site-start.el

Paste in this code: (from https://melpa.org/#/getting-started)

(require 'package) ;; You might already have this line
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line

Save and exit.

Second, install haskell-mode

To get haskell pretty-printing and indentation, do this to install haskell-mode:

emacs
M-x package-list-packages RET (Type meta-key and S, then type package-list-packages and hit return)
C-s haskell-mode RET (Type control-S to search, type nginx and hit return to find the haskell-mode package)
i (to mark it to install)
x (to execute installation of marked packages)

Use haskell-mode

Haskell mode will load automatically for haskell files. IF you want to load it manually, you can switch into haskell-mode with M-x haskell-mode.

Simon Woodside
  • 7,175
  • 5
  • 50
  • 66