[ocaml] support eliom files

Eliom/eliomi is ocsigen's extensions for its files using the eliom ppx.

More info at http://ocsigen.org/eliom/6.6/manual/ppx-syntax
This commit is contained in:
Clement Busschaert 2020-01-11 18:39:14 +01:00
parent 18301b0b9a
commit fd130a9c2e
No known key found for this signature in database
GPG key ID: 5FD5C5C840B9DB58

View file

@ -113,4 +113,9 @@
(setq +format-with 'ocp-indent) (setq +format-with 'ocp-indent)
(when (and (executable-find "ocamlformat") (when (and (executable-find "ocamlformat")
(locate-dominating-file default-directory ".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)))) (setq +format-with 'ocamlformat))))