racket-mode icon indicating copy to clipboard operation
racket-mode copied to clipboard

.dir-locals.el support for custom syntax

Open juszczakn opened this issue 4 years ago • 1 comments

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.

juszczakn avatar Sep 24 '19 23:09 juszczakn

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.)

greghendershott avatar Oct 22 '19 20:10 greghendershott