Skip to content

Commit f4b1841

Browse files
committed
Detect when 'auto option for haskell-process-type should use 'stack-ghci
1 parent c9b6712 commit f4b1841

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

haskell-customize.el

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,16 @@ same vein as `haskell-indent-spaces'."
397397
(defun haskell-process-type ()
398398
"Return `haskell-process-type', or a guess if that variable is 'auto."
399399
(if (eq 'auto haskell-process-type)
400-
(if (locate-dominating-file
401-
default-directory
402-
(lambda (d)
403-
(or (file-directory-p (expand-file-name ".cabal-sandbox" d))
404-
(cl-find-if (lambda (f) (string-match-p ".\\.cabal\\'" f)) (directory-files d)))))
405-
'cabal-repl
406-
'ghci)
400+
(cond
401+
((locate-dominating-file default-directory "stack.yaml")
402+
'stack-ghci)
403+
((locate-dominating-file
404+
default-directory
405+
(lambda (d)
406+
(or (file-directory-p (expand-file-name ".cabal-sandbox" d))
407+
(cl-find-if (lambda (f) (string-match-p ".\\.cabal\\'" f)) (directory-files d)))))
408+
'cabal-repl)
409+
(t 'ghci))
407410
haskell-process-type))
408411

409412
(provide 'haskell-customize)

0 commit comments

Comments
 (0)