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 syntax-coloring purposes, the command character is set in the `get-info` 
function for the #lang, which in pollen looks like this:

(define (get-info in mod line col pos)
      (λ (key default)
        (case key
          [(color-lexer)
           (define make-scribble-inside-lexer2
             (dynamic-require 'syntax-color/scribble-lexer 
'make-scribble-inside-lexer (λ () #f)))
           (cond [make-scribble-inside-lexer2
                  (make-scribble-inside-lexer2 #:command-char #\◊)]
                 [else default])]
          [else default])))


I could set the command character properly if I had access to the path of the 
source file. But IIUC DrRacket invokes the `get-info` for a #lang on a "global" 
basis, i.e., before it considers any source-specific information.


2) DrRacket seems to cache the result of `get-info` for a whole session. So 
even if I could set the command character correctly for the first source file, 
it wouldn't change if I had multiple source files open with multiple command 
characters (in different tabs or windows).




-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to