Skip to content

Add neocaml-mode support to ocamlformat-before-save#2787

Open
bbatsov wants to merge 2 commits intoocaml-ppx:mainfrom
bbatsov:add-neocaml-mode-support
Open

Add neocaml-mode support to ocamlformat-before-save#2787
bbatsov wants to merge 2 commits intoocaml-ppx:mainfrom
bbatsov:add-neocaml-mode-support

Conversation

@bbatsov
Copy link
Copy Markdown

@bbatsov bbatsov commented Mar 19, 2026

neocaml is a new tree-sitter based OCaml major mode for Emacs. This adds neocaml-mode and neocaml-interface-mode to the mode whitelist in ocamlformat-before-save so format-on-save works in neocaml buffers.

Currently users who switch from tuareg-mode to neocaml-mode lose format-on-save silently because the memq check doesn't recognize the new modes.

neocaml (https://github.com/bbatsov/neocaml) is a new tree-sitter
based OCaml major mode for Emacs.  Add `neocaml-mode` and
`neocaml-interface-mode` to the mode whitelist in
`ocamlformat-before-save` so format-on-save works in neocaml
buffers.
@EmileTrotignon
Copy link
Copy Markdown
Collaborator

Looks good to me, too bad it happened right after release

@bbatsov
Copy link
Copy Markdown
Author

bbatsov commented Mar 19, 2026

Yeah, that's unfortunate. Still, I guess many people install the package from MELPA, so for them that won't be an issue.

Copy link
Copy Markdown
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

Do you think we should keep a changelog for the emacs mode ? Even if it ends up being distributed in a different way, I think it would be a nice touch to have it in the main changelog.

@Julow
Copy link
Copy Markdown
Collaborator

Julow commented Mar 20, 2026

The CI is broken because unrelated issues (fixed in #2789 and #2790)

@bbatsov
Copy link
Copy Markdown
Author

bbatsov commented Mar 20, 2026

Do you think we should keep a changelog for the emacs mode ? Even if it ends up being distributed in a different way, I think it would be a nice touch to have it in the main changelog.

Having a changelog is never a bad idea IMO. Should add a separate file for the package or update the main changelog? I guess that's up to you.

@Julow
Copy link
Copy Markdown
Collaborator

Julow commented Mar 23, 2026

In the main changelog in a ### Emacs mode sub-section or similar would be good.

@bbatsov
Copy link
Copy Markdown
Author

bbatsov commented Mar 31, 2026

@EmileTrotignon Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants