Hi Yuhao: The Scribble indentation mode is currently implemented by adding a keymap that overrides the tab key. You can find the implementation here of the callback itself here:
https://github.com/racket/gui/blob/master/gui-lib/scribble/private/indentation.rkt and the code that communicates with DrRacket to install it is here: https://github.com/plt/racket/blob/master/pkgs/at-exp-lib/scribble/base/reader.rkt You can find documentation on how that wiring works here: http://docs.racket-lang.org/tools/Editor_Modes.html?q=definitions-text-surrogate#%28idx._%28gentag._27._%28lib._scribblings%2Ftools%2Ftools..scrbl%29%29%29 hth, Robby On Mon, Jun 15, 2015 at 11:20 PM, Yuhao Dong <yd2d...@uwaterloo.ca> wrote: > Greetings Racketeers, > > I'm trying to make my own #lang that has a non-sexp syntax, like Scribble. > However, the problem is the DrRacket always tries to indent my code as if it > were Racket, which is extremely unusable and annoying. > > Since changing DrRacket's indenting behaviors seems undocumented, I looked > at how Scribble did it, and then I put what I thought must be correct code > here: > > https://github.com/quantum1423/mir/blob/master/lang/reader.rkt > > However, DrRacket still indents my code as if it were Racket, although it > does turn off syntax highlighting correctly. I added the with-output-to-file > line to see if the drracket:indentation branch is ever executed, but > apparently it isn't. > > How does Scribble manage to get DrRacket to indent it in a non-sexp way? > > Thanks! > Yuhao Dong > > -- > 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. -- 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.