Skip to content

Commit af97a6e

Browse files
committed
Merge pull request #1114 from mikesperber/process-path-lists
Allow haskell-process-path-* to be lists.
2 parents 66ed4e3 + 0207377 commit af97a6e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

haskell-process.el

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ HPTYPE is the result of calling `'haskell-process-type`' function."
8585
nil)
8686
(apply haskell-process-wrapper-function
8787
(list
88-
(cons haskell-process-path-ghci haskell-process-args-ghci)))))
88+
(append (haskell-process-path-to-list haskell-process-path-ghci)
89+
haskell-process-args-ghci)))))
8990
('cabal-repl
9091
(append (list (format "Starting inferior `cabal repl' process using %s ..."
9192
haskell-process-path-cabal)
@@ -94,7 +95,8 @@ HPTYPE is the result of calling `'haskell-process-type`' function."
9495
(apply haskell-process-wrapper-function
9596
(list
9697
(append
97-
(list haskell-process-path-cabal "repl")
98+
(haskell-process-path-to-list haskell-process-path-cabal)
99+
(list "repl")
98100
haskell-process-args-cabal-repl
99101
(let ((target (haskell-session-target session)))
100102
(if target (list target) nil)))))))
@@ -105,11 +107,18 @@ HPTYPE is the result of calling `'haskell-process-type`' function."
105107
(apply haskell-process-wrapper-function
106108
(list
107109
(append
108-
(list haskell-process-path-stack "ghci")
110+
(haskell-process-path-to-list haskell-process-path-stack)
111+
(list "ghci")
109112
(let ((target (haskell-session-target session)))
110113
(if target (list target) nil))
111114
haskell-process-args-stack-ghci))))))))
112115

116+
(defun haskell-process-path-to-list (path)
117+
"Convert a path (which may be a string or a list) to a list."
118+
(if (stringp path)
119+
(list path)
120+
path))
121+
113122
(defun haskell-process-make (name)
114123
"Make an inferior Haskell process."
115124
(list (cons 'name name)))

0 commit comments

Comments
 (0)