haskell: make ghc-mod optional

This commit is contained in:
Michel Kuhlmann 2015-06-17 07:40:30 +02:00 committed by syl20bnr
parent 6e549cbe2a
commit d58895773e
3 changed files with 21 additions and 3 deletions

View file

@ -10,6 +10,7 @@
- [[#cabal-packages][Cabal packages]]
- [[#os-x][OS X]]
- [[#optional-extras][Optional extras]]
- [[#ghc-mod-support][ghc-mod support]]
- [[#ghci-ng-support][GHCi-ng support]]
- [[#structured-haskell-mode][structured-haskell-mode]]
- [[#hindent][hindent]]
@ -43,7 +44,6 @@ To use this contribution add it to your =~/.spacemacs=
** Cabal packages
This layer requires some [[https://www.haskell.org/cabal/][cabal]] packages:
- =ghc-mod=
- =hlint=
- =stylish-haskell=
- =hasktags=
@ -51,7 +51,7 @@ This layer requires some [[https://www.haskell.org/cabal/][cabal]] packages:
To install them, use the following command:
#+BEGIN_SRC sh
cabal install stylish-haskell hlint ghc-mod hasktags
cabal install stylish-haskell hlint hasktags
#+END_SRC
Then you have to add this path to your system =$PATH= (preferred):
@ -82,6 +82,20 @@ Note that =emacs.app= for OS X does not pick up =$PATH= from =~/.bashrc= or
** Optional extras
The Haskell layer supports some extra features that can be enabled through
layer variables.
*** ghc-mod support
[[http://www.mew.org/~kazu/proj/ghc-mod/][ghc-mod]] enhances =haskell-mode= with for example templates, case-splitting and
much more. In order to use it you need to install the executable with
#+BEGIN_SRC sh
cabal install ghc-mod
#+END_SRC
and set the layer variable:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((haskell :variables haskell-enable-ghc-mod-support t)))
#+END_SRC
*** GHCi-ng support
[[https://github.com/chrisdone/ghci-ng][ghci-ng]] adds some nice features to =haskell-mode=, and is supported in

View file

@ -21,4 +21,7 @@
"If non-nil structured-haskell-mode support is enabled")
(defvar haskell-enable-hindent-style nil
"If non-nil structured-haskell-mode support is enabled")
"Style to use for formatting with hindent; available are: fundamental johan-tibell chris-done andrew-gibiansky. If nil hindent is disabled.")
(defvar haskell-enable-ghc-mod-support t
"If non-nil ghc-mod support is enabled")

View file

@ -42,6 +42,7 @@
(defun haskell/init-ghc ()
(use-package ghc
:defer t
:if haskell-enable-ghc-mod-support
:init (add-hook 'haskell-mode-hook 'ghc-init)
:config
(when (configuration-layer/package-usedp 'flycheck)