[racket] [DrRacket] Syntax-coloring for the Interactions Window

From: Timothy Nelson (tn at cs.wpi.edu)
Date: Wed Sep 22 20:07:17 EDT 2010

Hello all,

I have a two-part question about #languages and the interactions window.

(1) I have a language equipped with a syntax coloring lexer just
like in section 17.3.5 of the Racket docs. That works great for the
definitions window. However, I've changed the
current-read-interactions parameter so that the interactions window
uses my language's reader as well. Now both windows read the same
language, but they disagree on syntax coloring.

The docs don't seem to cover this. Is there a way to apply my
language's coloring lexer to *interactions* as well as definitions?

(2) Even though I've changed current-read-interactions, the REPL is
still treating some characters differently, e.g. if I enter:
> ; <enter>
or some spaces and then <enter>,

my reader isn't called until I input something else on the next
line. This makes me think there is another parameter that I'm missing.

The oddness is happening after the prompt prints, so I tried changing
the current-prompt-read parameter at the same time I change
current-read-interactions, but the change seems to be ignored. It
_does_ get used if I explicitly call read-eval-print-loop, but I can't
figure out how to change it for the "base" interactions-window
REPL. How can I change the prompt?

Thanks very much for your time,
- Tim

Posted on the users mailing list.