Skip to content

Commit 15c5019

Browse files
Added nix-shell-cabal-repl support.
1 parent 01b6391 commit 15c5019

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

haskell-process.el

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ See `haskell-process-do-cabal' for more details."
120120
'ghci
121121
"The inferior Haskell process type to use."
122122
:type '(choice (const ghci) (const cabal-repl) (const cabal-dev)
123-
(const cabal-ghci) (const nix-shell-ghci))
123+
(const cabal-ghci) (const nix-shell-ghci)
124+
(const nix-shell-cabal-repl))
124125
:group 'haskell-interactive)
125126

126127
(defcustom haskell-process-log
@@ -519,7 +520,8 @@ for various things, but is optional."
519520
path. This allows modules such as 'Path_...', generated by cabal,
520521
to be loaded by ghci."
521522
(unless (or (eq 'cabal-repl haskell-process-type) ;; redundant with "cabal repl"
522-
(eq 'nix-shell-ghci haskell-process-type))
523+
(eq 'nix-shell-ghci haskell-process-type)
524+
(eq 'nix-shell-cabal-repl haskell-process-type))
523525
(let*
524526
((session (haskell-session))
525527
(cabal-dir (haskell-session-cabal-dir session))
@@ -551,10 +553,15 @@ to be loaded by ghci."
551553
('nix-shell-ghci (concat haskell-process-path-nix-shell
552554
" "
553555
haskell-process-args-nix-shell
554-
" --command '")))
556+
" --command '"))
557+
('nix-shell-cabal-repl (concat haskell-process-path-nix-shell
558+
" "
559+
haskell-process-args-nix-shell
560+
" --command '")))
555561
(caddr state)
556562
(case haskell-process-type
557563
('nix-shell-ghci "'")
564+
('nix-shell-cabal-repl "'")
558565
(t ""))))))
559566

560567
:live
@@ -1086,6 +1093,19 @@ now."
10861093
(format "Starting inferior nix-shell (ghci) process using %s..."
10871094
(mapconcat 'identity args " "))
10881095
'face font-lock-comment-face))
1096+
(apply #'start-process
1097+
(append (list (haskell-session-name session)
1098+
nil)
1099+
args))))
1100+
('nix-shell-cabal-repl
1101+
(let ((args (append (list haskell-process-path-nix-shell)
1102+
haskell-process-args-nix-shell
1103+
'("--command" "cabal repl"))))
1104+
(haskell-process-log
1105+
(propertize
1106+
(format "Starting inferior nix-shell (cabal repl) process using %s..."
1107+
(mapconcat 'identity args " "))
1108+
'face font-lock-comment-face))
10891109
(apply #'start-process
10901110
(append (list (haskell-session-name session)
10911111
nil)

0 commit comments

Comments
 (0)