racket-mode
racket-mode copied to clipboard
.dir-locals.el support for custom syntax
Might be cool to provide supported vars that can be incorporated into syntax highlighting. That way, individual projects could create a .dir-local.el
that defines highlighting for custom syntax they have.
https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
Looks like racket--common-variables
in racket-common.el
and racket-font-lock.el
would be places to start.
Thank you for the suggestion. A couple quick brain-dump thoughts:
-
There's already the ability to specify custom indent, following the example of Emacs Lisp and Scheme modes, by setting a property on
racket-indent-function
. As it happens, you can also do this as a file- or directory-local setting by using the "variable"eval
. Maybe something similar could make sense for syntax highlighting -- but I haven't had time to think about it, much. -
Of course Racket lets a
#lang
supply its own indent and highlighting lexer, to Dr Racket. Racket Mode does not currently try to use these. Someday it could; assuming performance is satisfactory. (However: specifying indent only at the level of a#lang
seems the wrong granularity to me; custom syntax provided by a mere library also ought to be able to supply indent, somehow TBD/someday.)