|
86 | 86 |
|
87 | 87 | (defcustom haskell-process-args-nix-shell
|
88 | 88 | '("shell.nix")
|
89 |
| - "The path for starting nix-shell." |
| 89 | + "Any arguments for starting nix-shell." |
90 | 90 | :group 'haskell-interactive
|
91 | 91 | :type '(choice string (repeat string)))
|
92 | 92 |
|
@@ -120,7 +120,7 @@ See `haskell-process-do-cabal' for more details."
|
120 | 120 | 'auto
|
121 | 121 | "The inferior Haskell process type to use."
|
122 | 122 | :type '(choice (const auto) (const ghci) (const cabal-repl) (const cabal-dev) (const cabal-ghci)
|
123 |
| - (const nix-shell-ghci) (const nix-shell-cabal-repl) |
| 123 | + (const nix-shell-ghci) (const nix-shell-cabal-repl)) |
124 | 124 | :group 'haskell-interactive)
|
125 | 125 |
|
126 | 126 | (defcustom haskell-process-log
|
@@ -535,12 +535,17 @@ to be loaded by ghci."
|
535 | 535 | (defun haskell-process-type ()
|
536 | 536 | "Return `haskell-process-type', or a guess if that variable is 'auto."
|
537 | 537 | (if (eq 'auto haskell-process-type)
|
538 |
| - (if (locate-dominating-file default-directory |
539 |
| - (lambda (f) |
540 |
| - (or (string= ".cabal-sandbox" f) |
541 |
| - (string-match-p "\\.cabal\\'" f)))) |
542 |
| - 'cabal-repl |
543 |
| - 'ghci) |
| 538 | + (let ((nix-shell-found (locate-dominating-file default-directory |
| 539 | + (lambda (f) |
| 540 | + (string= "shell.nix" f)))) |
| 541 | + (cabal-found (locate-dominating-file default-directory |
| 542 | + (lambda (f) |
| 543 | + (or (string= ".cabal-sandbox" f) |
| 544 | + (string-match-p "\\.cabal\\'" f)))))) |
| 545 | + (cond ((and cabal-found nix-shell-found) 'nix-shell-cabal-repl) |
| 546 | + (cabal-found 'cabal-repl) |
| 547 | + (nix-shell-found 'nix-shell-ghci) |
| 548 | + (t 'ghci))) |
544 | 549 | haskell-process-type))
|
545 | 550 |
|
546 | 551 | (defun haskell-process-do-cabal (command)
|
|
0 commit comments