Minor comment revision & general code reformatting

This commit is contained in:
Henrik Lissner 2019-07-23 17:30:32 +02:00
parent be46d31866
commit 9eaee096c8
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 24 additions and 18 deletions

View file

@ -4,14 +4,14 @@
(use-package! intero
:commands intero-mode
:init
(defun +haskell|init-intero ()
"Initializes `intero-mode' in haskell-mode, unless stack isn't installed.
(add-hook 'haskell-mode-local-vars-hook
(defun +haskell-init-intero-h ()
"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-local-vars-hook #'+haskell|init-intero)
(when (derived-mode-p 'haskell-mode)
(if (executable-find "stack")
(intero-mode +1)
(message "Couldn't find stack. Refusing to enable intero-mode.")))))
:config
(setq haskell-compile-cabal-build-command "stack build --fast")
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition)

View file

@ -13,9 +13,15 @@
haskell-process-auto-import-loaded-modules t
haskell-process-show-overlays (not (featurep! :tools flycheck))) ; redundant with flycheck
(set-lookup-handlers! 'haskell-mode :definition #'haskell-mode-jump-to-def-or-tag)
(set-file-template! 'haskell-mode :trigger #'haskell-auto-insert-module-template :project t)
(set-repl-handler! '(haskell-mode haskell-cabal-mode literate-haskell-mode) #'+haskell/open-repl)
(set-lookup-handlers! 'haskell-mode
:definition #'haskell-mode-jump-to-def-or-tag)
(set-file-template! 'haskell-mode
:trigger #'haskell-auto-insert-module-template
:project t)
(set-repl-handler! '(haskell-mode
haskell-cabal-mode
literate-haskell-mode)
#'+haskell/open-repl)
(add-hook! 'haskell-mode-hook
#'(haskell-collapse-mode ; support folding haskell code blocks