On Thu, 11 Dec 2014 22:19:42 -0600, Peter Gammie <peteg42 at gmail.com> wrote:
Peter> Yes, I should have been clearer: this is not (just) about the Peter> emacs sml-mode but the generic emacs ?compile? machinery. The Peter> latter could be educated to understand Poly/ML?s warnings and Peter> errors, or Poly/ML could conform to some ?standard?. I was Peter> sounding David out about the latter, and also about Poly/ML?s Peter> REPL.
Peter> I saw your emails in the Poly/ML archives and was hoping you?d Peter> opine about how you interact with the system.
I mostly do the same as you: I have ML scripts that play the role of makefiles, by recursively sourcing ML files in a DFS of a project directory. They also spit out blurbs just like make does when it recurses, ie. "Entering directory foo" and "Leaving directory foo".
This works well enough with the Emacs compile mechanism. You know that you can have the compile command run anything, right? Not just make. So in my case the command is usually "poly < load-all.sml". With my hack Emacs can see the errors and warnings, colorizes them and makes them hot, so hitting Enter over them takes you to the error location. Or you can cycle through them in order with C-x ` just like in any other compilation. The make-like blurbs mean that this will even work for subdirectories.
As for the REPL, setting the variable sml-program-name and then using the command run-sml works for me: I get a comint-like buffer with all the usual features (mostly the searchable history) and poly as the interpreter. I may have had to add a tiny bit of code for this to Stefan's tree, I don't remember now. It definitely wasn't hard.
I haven't tried to use the debugger from Emacs yet. I guess I'll leave that for next time I feel really nostalgic (to reclaim a word I have seen used in this thread, but giving it a sweeter taste).