diff --git a/modules/lang/ocaml/config.el b/modules/lang/ocaml/config.el index 69ce17737..7772ef630 100644 --- a/modules/lang/ocaml/config.el +++ b/modules/lang/ocaml/config.el @@ -113,4 +113,9 @@ (setq +format-with 'ocp-indent) (when (and (executable-find "ocamlformat") (locate-dominating-file default-directory ".ocamlformat")) + (let ((ext (file-name-extension buffer-file-name t))) + (cond ((equal ext ".eliom") + (setq-local ocamlformat-file-kind 'implementation)) + ((equal ext ".eliomi") + (setq-local ocamlformat-file-kind 'interface)))) (setq +format-with 'ocamlformat))))