Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-28 Thread Matthew Butterick
> Anyway, In DrRacket, files are not always saved before they are run so > you cannot reliably get a path. In general, the source name of a > syntax object or the object-name of a port doesn't have to be anything > in particular and the source location of the file is generally only > available when

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-28 Thread Robby Findler
I don't want to lay claim to suggesting this technique as I am not sure it is a good idea. I mean to be explaining that, not suggesting you use it in my earlier message. :) In particular, it means that if you put a syntax error (or malicious code) into the pollen config then you will crash DrRacke

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-28 Thread Matthew Butterick
> But now that looked at the pollen docs, I see the issue. It looks like > you have to be able to run the config submodule of some program to be > able to figure out how to syntax color it I'm making progress with your suggested technique but hitting a dead end inside DrRacket. Here's what I've

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-27 Thread Matthew Butterick
> It looks like > you have to be able to run the config submodule of some program to be > able to figure out how to syntax color it? Right, that's the way the config logic works, and I'm trying to figure out how to hook the syntax colorer into that logic. > That's not generally something that

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-27 Thread Robby Findler
That is indeed how. But now that looked at the pollen docs, I see the issue. It looks like you have to be able to run the config submodule of some program to be able to figure out how to syntax color it? That's not generally something that is well-supported, although I suppose you could make it wo

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-27 Thread mb
Sorry for the noob question, but broadly, how does one affect the behavior of the syntax colorer (and thereby the lexer) from the #lang (if not through `get-info`)? On Friday, November 27, 2015 at 8:37:47 AM UTC-8, Robby Findler wrote: > I think that you have to make the syntax colorer discover

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-27 Thread Robby Findler
I think that you have to make the syntax colorer discover which is the @ character in the same way "#lang pollen" discovers it and then pass that along to the scribble-inside-lexer. (This may require changing scribble-inside-lexer to be more flexible in when it accepts the character.) Lexers have a

[racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-27 Thread mb
In `#lang pollen`, which uses a variant of at-expressions, you can change the command character on a per-source-file basis, so you can say `◊(+ 1 1)` or `∆(+ 1 1)` or `@(+ 1 1)` ... I'm trying to figure out if I can bubble this up to DrRacket for syntax coloring. I see two wrinkles: 1) For syn