Neocaml-mode (A modern Emacs major mode for OCaml) is looking for testers

Yeah, I’m certainly open to improving the upstream defaults. Feel free to open issues with concrete suggestions, so we can discuss them in a more focused manner.

1 Like

This morning I did a bit of a re-org of the font-lock defaults in neocaml, prompted by the discussion here. I haven’t addressed the specific issues we’ve been discussing, but I did notice that I actually hadn’t done some changes I thought I had already done… :sweat_smile:

In a nutshell:

  • Moved type from level 3 to level 2 and number from level 2 to level 3
  • Split escape-sequence out of string into its own feature at level 3
  • Split property (record fields) and label (labeled arguments) out of variable into their own features at level 4

New layout:

Level Features
1 comment, definition
2 keyword, string, type
3 attribute, builtin, constant, escape-sequence, number
4 operator, bracket, delimiter, variable, property, label, function

Now the defaults are actually aligned with the official Emacs suggestions, and the features are more granular and more aligned with what an OCaml programmer might want to font-lock differently.

3 Likes

FYI - Release v0.4.0 · bbatsov/neocaml · GitHub

You’ll need to update your Tree-sitter grammars due to some upstream (breaking) changes in the TS OCaml grammar.

1 Like