forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-haskell.el
31 lines (23 loc) · 1.04 KB
/
init-haskell.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(require-package 'haskell-mode)
(dolist (hook '(haskell-mode-hook inferior-haskell-mode-hook))
(add-hook hook 'turn-on-haskell-doc-mode))
(add-auto-mode 'haskell-mode "\\.ghci\\'")
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(add-hook 'haskell-mode-hook (lambda () (subword-mode +1)))
(after-load 'haskell-mode
(define-key haskell-mode-map (kbd "C-c h") 'hoogle)
(define-key haskell-mode-map (kbd "C-o") 'open-line))
(when (eval-when-compile (>= emacs-major-version 24))
(require-package 'ghci-completion)
(add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion))
(eval-after-load 'page-break-lines
'(push 'haskell-mode page-break-lines-modes))
;; Make compilation-mode understand "at blah.hs:11:34-50" lines output by GHC
(after-load 'compile
(let ((alias 'ghc-at-regexp))
(add-to-list
'compilation-error-regexp-alist-alist
(list alias " at \\(.*\\.\\(?:l?[gh]hs\\|hi\\)\\):\\([0-9]+\\):\\([0-9]+\\)-[0-9]+$" 1 2 3 0 1))
(add-to-list
'compilation-error-regexp-alist alias)))
(provide 'init-haskell)