Closed purcell closed 6 years ago
This doesn't work for me with Elm 0.19. I get the following error:
Wrong type argument: stringp, ("repl")
Hmm. With 2852fea, I can put the following in a .dir-locals.el
file in an Elm 0.19 project and successfully start the repl.
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((elm-mode
(elm-interactive-command . ("elm" "repl"))
(elm-reactor-command . ("elm" "reactor"))
(elm-compile-command . ("elm" "make"))
(elm-package-command . ("elm" "package"))
(elm-package-json . "elm.json")))
@purcell We've ported our project to Elm 0.19. I've made a .dir-locals.el
file with the contents as you describe. To get Elm-Compile
to work I've had to change the compile arguments here https://github.com/jcollard/elm-mode/pull/139/files#diff-c3633a01c792e88846f0ecf0214a49e0R95 - replacing "--yes"
and "--warn"
with just "--debug"
.
EDIT - a better way is to add elm-compile-arguments
to .dir-locals.el
like so:
((elm-mode
(elm-compile-arguments . ("--output=elm.js" "--debug"))
(elm-interactive-command . ("elm" "repl"))
(elm-reactor-command . ("elm" "reactor"))
(elm-compile-command . ("elm" "make"))
(elm-package-command . ("elm" "package"))
(elm-package-json . "elm.json")))
Thanks @crudbetter, that's encouraging.
I've tried both versions of .dir-locals.el from above, but neither worked for me. I wonder if it's because I'm using Spacemacs, or emacs 26.1...
@mattsawyer77 You'd have to re-open your elm file before trying it, so that it picks up the .dir-locals.el
values -- you should get prompted for them. (M-x normal-mode
should also trigger this.)
BTW, a fuller .dir-locals.el
for Elm 0.19 is the following:
((elm-mode
(elm-interactive-command . ("elm" "repl"))
(elm-reactor-command . ("elm" "reactor"))
(elm-reactor-arguments . ("--port" "8000"))
(elm-compile-command . ("elm" "make"))
(elm-compile-arguments . ("--output=elm.js" "--debug"))
(elm-package-command . ("elm" "package"))
(elm-package-json . "elm.json")))
I see the variable getting set as intended. describe-variable
for elm-interactive-command
gives
elm-interactive-command is a variable defined in ‘elm-interactive.el’. Its value is ("elm" "repl") Original value was "elm-repl"
Note, I'm using the stock elm-mode package, not this branch/fork...maybe that's the disconnect here?
Yeah, you'd absolutely need this branch, but I'm about to merge it to master
because it shouldn't break existing configs.
Default commands are still those for Elm 0.18, but Elm 0.19's commands can now be used by setting the appropriate custom vars as follows, or in directory local variables for an Elm 0.19 project:
Tested with 0.18 - looking for feedback from a 0.19 user that this works.