Skip to content

Commit 79b033c

Browse files
committed
(haskell-compile): fix for haskell-build-type = 'cabal-project
had forgotten this case. Uses cabal build commands but appends target "all" since there is no default when at the cabal.project level.
1 parent 8efff9d commit 79b033c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

haskell-compile.el

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,15 @@ base directory for build tools, or the current buffer for
189189
(t (error "Invalid haskell-compiler-type")))
190190
;; now test htype and compile
191191
(cond
192-
((eq htype 'cabal)
193-
(haskell--compile dir edit-command
194-
'haskell--compile-cabal-last
195-
haskell-compile-cabal-build-command
196-
haskell-compile-cabal-build-alt-command))
192+
((or (eq htype 'cabal) (eq htype 'cabal-project)) ; run cabal
193+
(let ((command haskell-compile-cabal-build-command)
194+
(alt-command haskell-compile-cabal-build-alt-command))
195+
(when (eq htype 'cabal-project) ;no default target
196+
(setq command (concat command " all")
197+
alt-command (concat alt-command " all")))
198+
(haskell--compile dir edit-command
199+
'haskell--compile-cabal-last
200+
command alt-command)))
197201
((eq htype 'stack)
198202
(haskell--compile dir edit-command
199203
'haskell--compile-stack-last

haskell-customize.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ presence of a *.cabal file or stack.yaml file or something similar.")
437437
((and cabal-project (executable-find "cabal"))
438438
(cons 'cabal-project cabal-project))
439439
((and cabal-sandbox (executable-find "cabal"))
440-
(cons 'cabal-sandbox cabal-sandbox))
440+
(cons 'cabal cabal-sandbox))
441441
((and stack (executable-find "stack"))
442442
(cons 'stack stack))
443443
((and cabal (executable-find "cabal"))

0 commit comments

Comments
 (0)