doomemacs/modules/lang/haskell/+intero.el
Henrik Lissner e05d7cfee0
Change flycheck initialization strategy
Initialize it globally and turn it off where needed, instead of enabling
it on demand. Also fixes void-function: flycheck-mode errors when
:feature syntax-checker is disabled. This is experimental.

Indirectly fixes #710
2018-06-22 01:49:20 +02:00

20 lines
708 B
EmacsLisp

;;; lang/haskell/+intero.el -*- lexical-binding: t; -*-
;;;###if (featurep! +intero)
(def-package! intero
:commands intero-mode
:init
(defun +haskell|init-intero ()
"Initializes `intero-mode' in haskell-mode, unless stack isn't installed.
This is necessary because `intero-mode' doesn't do its own error checks."
(when (derived-mode-p 'haskell-mode)
(if (executable-find "stack")
(intero-mode +1)
(message "Couldn't find stack. Refusing to enable intero-mode."))))
(add-hook 'haskell-mode-hook #'+haskell|init-intero)
:config
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition))
(def-package! hindent
:hook (haskell-mode . hindent-mode))