From 134c813c46cddc7fafd8fcd01c7ae370f405bac6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 16 Mar 2017 17:22:13 -0400 Subject: [PATCH] lang/haskell: fix haskell-mode + add dante --- modules/lang/haskell/config.el | 23 ++++++++++++++++------- modules/lang/haskell/packages.el | 1 + 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index 6a08a7283..3e890de82 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -1,20 +1,29 @@ ;;; module-haskell.el -(def-package! haskell +;; Requires cabal installed for syntax-checking, and ghci (or hugs) to be +;; installed for REPL support. + +(def-package! haskell-mode :mode (("\\.hs$" . haskell-mode) ("\\.ghci$" . ghci-script-mode) ("\\.cabal$" . haskell-cabal-mode)) :interpreter (("runghc" . haskell-mode) ("runhaskell" . haskell-mode)) - :init - (add-hook! haskell-mode '(interactive-haskell-mode flycheck-mode)) :config + (load "haskell-mode-autoloads" nil t) + (set! :popup "*debug:haskell*" :size 20) (set! :repl 'haskell-mode 'switch-to-haskell) - (push ".hi" completion-ignored-extensions)) + (push ".hi" completion-ignored-extensions) + + (autoload 'switch-to-haskell "inf-haskell" nil t) + (after! inf-haskell + (map! :map inf-haskell-mode-map "ESC ESC" 'doom/popup-close))) -(def-package! inf-haskell ; part of haskell - :commands (inferior-haskell-mode inf-haskell-mode switch-to-haskell) - :config (map! :map inf-haskell-mode-map "ESC ESC" 'doom/popup-close)) +(def-package! dante + :after haskell-mode + :config + (when (executable-find "cabal") + (add-hook! 'haskell-mode-hook '(flycheck-mode dante-mode)))) diff --git a/modules/lang/haskell/packages.el b/modules/lang/haskell/packages.el index 7b09b8e01..8b9c36ec8 100644 --- a/modules/lang/haskell/packages.el +++ b/modules/lang/haskell/packages.el @@ -2,4 +2,5 @@ ;;; lang/haskell/packages.el (package! haskell-mode) +(package! dante)