[racket] examples of hooking a #lang into DrRacket?
At Mon, 21 Jul 2014 01:32:21 -0500, Robby Findler wrote:
> On Mon, Jul 21, 2014 at 12:53 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> > Currently, `read-language` does return #f when `get-info` is not
> > available. I'm not sure anymore whether that was intended, but since it
> > has worked that way for a while, and since the intent of
> > `read-language` is to report the `get-info` function, then I think the
> > way forward here is to fix the documentation.
>
> Okay.
>
> > It sounds like DrRacket is handling a `#f` result ok: it should only
> > support syntax coloring if a language specifies a 'color-lexer
> > configuration via `get-info`, and so if `get-info` is not provided,
> > then no 'color-lexer configuration is available. Or is `get-info`
> > provided and somehow not recognized?
>
> Syntax coloring is one thing and that's what's turning things red,
> yes. But I think that a language that defines a get-info that returns
> the default value for color-lexer should get the same behavior as when
> read-language returns #f. The former currently gets the racket-lexer.
> Do you think that behavior should change?
>
> (DrRacket also consults the read-language returned get-info procedure
> for other things, including the lack of buttons that Matthew B.
> reported. As it happens, the "returns #f" path is currently going thru
> the "raises exn" path, which is probably not what we want.)
I guess I'm conflating "colors syntax" and "turns the #lang line
black". In the absence of `get-info`, it seems fine to turn the #lang
line red and default to S-expression coloring for the module content.
Thanks for reminding me of the original issue. I agree that a #f result
from `read-language` should leave a default set of buttons, including
"Run".