ocamlformat icon indicating copy to clipboard operation
ocamlformat copied to clipboard

Emacs error popup

Open qcfu-bu opened this issue 2 years ago • 3 comments

When using ocamlformat under emacs, a buffer pops up very often saying the following

ocamlformat errors:
ocamlformat: SRC… arguments: no '117-117' file
Usage: ocamlformat [OPTION]… [SRC]…
Try 'ocamlformat --help' for more information.

The '117-117' range would be lines on which I typed a couple of newlines. This behavior happens even on files that pass ocaml typechecking.

Currently using ocamlformat 22.4.

qcfu-bu avatar Jul 07 '22 14:07 qcfu-bu

I tried again with the most recent release and didn't witness any issue. Do you have a concrete example? Did you configure emacs following the instructions of https://ocaml.org/p/ocamlformat/0.23.0/doc/editor_setup.html or do you have a custom setup?

gpetiot avatar Jul 19 '22 10:07 gpetiot

I'm using the lastest version of doom emacs. I have upgraded the ocamlformat package to the lastest version, but this issues still persists. I will try again with a vanilla emacs config to see if it's a problem on doom's side in which case I will report an issue with them.

qcfu-bu avatar Aug 02 '22 16:08 qcfu-bu

Can confirm this bug. It happens when entering a new line and ocamlformat-line is called. I'm using ocamlformat 0.24.1 and the latest doom emacs. Is it possible that the doom emacs ocaml package needs an upgrade?

edit: Manually applying https://github.com/ocaml-ppx/ocamlformat/commit/f986a50fbee85e4f955c39972a28894402fdec7a fixed the issue on my setup

tjammer avatar Aug 06 '22 08:08 tjammer

After a recent update to doom emacs, this is no longer an issue.

qcfu-bu avatar Aug 21 '22 04:08 qcfu-bu