I moved my project into dunes and now I have a probably very stupid question:
Let’s say, I’m in Emacs editing my dune or .ml file. How can I start building my entire project from inside Emacs and get the list of all errors in all files? I did try С-с С-с with “dune build @install” and “make -f /path/to/my/project/Makefile”. Doesn’t work.
cd really helped which is a little bit confusing as from the command line I can run dune from every subdirectory of the project and everything works as expected.
I’ve been looking for a solution that won’t require keeping a terminal session open, and while the accepted approach here gets me close, it doesn’t quite work out. If I use @ejgallego’s function as is, then it doesn’t pick up my opam switch environment. But if I prefix the build command with opam exec -- <...> then it seems to not be depositing the build artifacts in the correct location!
I’ll keep noodling around on this, but if anyone knows a better way off the top of their heads I’d be grateful for it.
Ultimately, I’d like an emacs integration with dune --watch, that will give me push notifications when something in the project breaks, rather than having to pull that info out by telling dune to build manually. But I’d be happy if I could get a clean build/fix cycle working inside of emacs for a start
This is great! Thanks so much for sharing, @Gopiandcode It makes my weekend.
I’ve played with a lit a little, and already find it very useful! I imagine it could be noodled on to provide an really wonderful, minimally invasive but maximally informative, assistant to ocaml dev.
Would you be interested in submitting this upstream so it could become part of the official dune-mode or tuareg (unless there’s a better fit)? Or, if not, on getting packaged and into melpa?
Hi @shonfeder, thanks for the feedback! If there’s interest in integrating with dune-mode or tuareg or publishing it as a standalone package, I’d be happy to do so.