On this page:
6.1 Color Schemes
6.2 General-purpose Modes

6 Editor Modes

6.1 Color Schemes

DrRacket uses the framework’s color schemes to colorize source text and other aspects of itself. See color-prefs:register-info-based-color-schemes for details on how to add new color schemes via "info.rkt" files.

6.2 General-purpose Modes

DrRacket provides support for multiple editor modes based on the #lang line at the beginning of the editor. If the Modes submenu of the Edit menu has the Racket mode chosen (which is the default if the Language dialog’s “The Racket Language” is chosen), then DrRacket calls the language’s get-info procedure (see read-language for more about how to set up a language’s get-info procedure) with 'definitions-text-surrogate. This is expected to return a quoted module path (in the sense of module-path?) that names a module that exports surrogate%. It is expected to be bound to a class implementing the mode:surrogate-text<%> interface. Assuming so, it is used as the surrogate for the definitions text.

Additionally, plugins can register modes via drracket:modes:add-mode. Each mode is visible in the Modes submenu of the Edit menu. Initially, DrRacket only supports two modes: Racket mode and text mode.

DrRacket automatically selects a mode for each open file based on the file’s extension (and the language chosen as described above). If the file ends with .txt, DrRacket uses text mode. Otherwise, DrRacket uses Racket mode.