|
38 | 38 | :group 'haskell)
|
39 | 39 |
|
40 | 40 | (defcustom haskell-compile-cabal-build-command
|
41 |
| - "cd %s && cabal build --ghc-option=-ferror-spans" |
| 41 | + "cabal build --ghc-option=-ferror-spans" |
42 | 42 | "Default build command to use for `haskell-cabal-build' when a cabal file is detected.
|
43 |
| -The `%s' placeholder is replaced by the cabal package top folder." |
| 43 | +For legacy compat, `%s' is replaced by the cabal package top folder." |
44 | 44 | :group 'haskell-compile
|
45 | 45 | :type 'string)
|
46 | 46 |
|
47 | 47 | (defcustom haskell-compile-cabal-build-alt-command
|
48 |
| - "cd %s && cabal clean -s && cabal build --ghc-option=-ferror-spans" |
| 48 | + "cabal clean -s && cabal build --ghc-option=-ferror-spans" |
49 | 49 | "Alternative build command to use when `haskell-cabal-build' is called with a negative prefix argument.
|
50 |
| -The `%s' placeholder is replaced by the cabal package top folder." |
| 50 | +For legacy compat, `%s' is replaced by the cabal package top folder." |
51 | 51 | :group 'haskell-compile
|
52 | 52 | :type 'string)
|
53 | 53 |
|
54 | 54 | (defcustom haskell-compile-stack-build-command
|
55 |
| - "cd %s && stack build --fast" |
| 55 | + "stack build --fast" |
56 | 56 | "Default build command to use for `haskell-stack-build' when a stack file is detected.
|
57 |
| -The `%s' placeholder is replaced by the stack package top folder." |
| 57 | +For legacy compat, `%s' is replaced by the stack package top folder." |
58 | 58 | :group 'haskell-compile
|
59 | 59 | :type 'string)
|
60 | 60 |
|
61 | 61 | (defcustom haskell-compile-stack-build-alt-command
|
62 |
| - "cd %s && stack clean && stack build --fast" |
| 62 | + "stack clean && stack build --fast" |
63 | 63 | "Alternative build command to use when `haskell-stack-build' is called with a negative prefix argument.
|
64 |
| -The `%s' placeholder is replaced by the stack package top folder." |
| 64 | +For legacy compat, `%s' is replaced by the stack package top folder." |
65 | 65 | :group 'haskell-compile
|
66 | 66 | :type 'string)
|
67 | 67 |
|
@@ -197,15 +197,19 @@ base directory for build tools, or the current buffer for
|
197 | 197 | ('- alt)
|
198 | 198 | (_ (compilation-read-command default))))
|
199 | 199 | (command (format template dir-or-file))
|
| 200 | + (dir (if (directory-name-p dir-or-file) |
| 201 | + dir-or-file |
| 202 | + default-directory)) |
200 | 203 | (name (if (directory-name-p dir-or-file)
|
201 | 204 | (file-name-base (directory-file-name dir-or-file))
|
202 | 205 | (file-name-nondirectory dir-or-file))))
|
203 | 206 | (unless (eq edit'-)
|
204 | 207 | (set last-sym template))
|
205 |
| - (compilation-start |
206 |
| - command |
207 |
| - 'haskell-compilation-mode |
208 |
| - (lambda (mode) (format "*%s* <%s>" mode name))))) |
| 208 | + (let ((default-directory dir)) |
| 209 | + (compilation-start |
| 210 | + command |
| 211 | + 'haskell-compilation-mode |
| 212 | + (lambda (mode) (format "*%s* <%s>" mode name)))))) |
209 | 213 |
|
210 | 214 | (provide 'haskell-compile)
|
211 | 215 | ;;; haskell-compile.el ends here
|
0 commit comments