ocaml-ppx / ocamlformat

Auto-formatter for OCaml code
MIT License
633 stars 179 forks source link

Allow custom commands for running ocamlformat #2577

Closed gridbugs closed 1 month ago

gridbugs commented 2 months ago

Currently it's possible to customize the path or name of the ocamlformat executable that gets run by the emacs ocamlformat package. However sometimes it's desirable to run ocamlformat by running a multi-word command, such as opam exec ocamlformat --. This change adds support running coamlformat with custom multi-word commands by allowing the ocamlformat-command variable to be set to a list of strings.

gridbugs commented 2 months ago

The context for this PR is that I'm in the process of adding a feature to dune that will download, build, and then run ocamlformat from a single dune command. I've been testing the command in different editors and this patch is necessary in order to use this feature in emacs.

gridbugs commented 1 month ago

Updated the changelog

Julow commented 1 month ago

Thanks :)