[MLton] Re: Ray tracer update

Stephen J. Bevan stephen@dino.dnsalias.com
Wed, 15 Jun 2005 19:07:45 -0700

Stephen Weeks writes:
 > The elisp code that I use on a daily basis to step through MLton
 > errors is in the MLton CVS.  There is a pointer to it at
 >  http://mlton.org/Emacs

BTW I looked for Emacs information on the MLton site but didn't find a
link to this page.

 > It's not a big complex mode or anything like that.  But it works very
 > well for me.

I didn't really want to change modes just to see the error messages so
I'll probably stick with the solution I'm currently using which is to
massage the error messages into a format that Emacs likes (see below)

 > What would be needed to make the MLton error format friendly to emacs?

Instead of :-

  Error: hello.sml 3.12.
    Syntax error: deleting  RPAREN ARROW.

generate :-

    Syntax error: deleting  RPAREN ARROW.

I'll be the first to agree that the format you are currently using is
more visually friendly, but the latter is what Emacs is looking for so
(like GNU Ada) it would be handy to have it as an option in the compiler.

 > Perhaps a simple sed postprocessor could massage MLton's format into
 > what's needed?

Here's one that works for me in Emacs :-

  sed -e 's/^\([W|E].*\): \([^ ]*\) \([0-9][0-9]*\)\.\([0-9][0-9]*\)\./\2:\3:\1:\4/'

This should also work for anyone who likes to process there errors
with error(1) -- warning I've not tested the sed pattern with error(1)
since I don't it.