I have a long-running topic branch, hash-lang
, on which I've been exploring how to use #lang
supplied colors and indent.
Instead of this dragging on for N more years, I'd really like to merge it soon. I've been working on it a lot the last couple months.
Why so long
My main concerns have been around: performance; the need for a live back end racket process just to edit a file; how to fit in with the rest of the Emacs ecosystem that only knows about Emacs "char-syntax" not tokens (e.g. still using things like paredit
when the lang uses s-expressions); configuring other Emacs details based on the module language; coordinating with @robby to add a lang info key about comments; contemplating how much "plainer" the token coloring is vs. "classic" racket-mode
; miscellaneous other questions and anxieties.
The latest approach
Where I've ended up is that the "classic" Emacs-implemented racket-mode
will remain. There's a new, alternative major mode, racket-hash-lang-mode
, for edit buffers. People can use either mode for various kinds of files as they prefer. Can even switch between major modes in a live buffer.
I wrote an overview, "Which major mode to use" for my Guide docs. (After merge, that would be live on racket-mode.com
.)
If you want to try
A few brave people have been trying it from time to time, and reporting issues.
I do have two open issues I can't reproduce, which are my last speed bumps to merging.
Although I'm OK merging it with an "Experimental!" label, I'd love to get a few more testers, first.
Would you like to try?
If you use something like straight.el
for packages, you already know what to do.
Or if you've installed Racket Mode from MELPA, then the instructions are something like:
M-x package-delete <RET> racket-mode
.git clone https://github.com/greghendershott/racket-mode.git
cd
there andgit checkout hash-lang
- In your Emacs init file, add that dir to your
load-path
. If you useuse-package
, change the:ensure t
line to:load-path <dir>
. Otherwise(add-to-list 'load-path <dir>)
. - Restart Emacs
(Someday to revert, just undo step 4, and package-install
racket-mode
again.)
If you have trouble, ask here or open an issue.