Merge pull request #2353 from facelesspanda/lang/eliom

lang/ocaml: support eliom files
This commit is contained in:
Henrik Lissner 2020-01-20 02:28:48 -05:00 committed by GitHub
commit a5ff21f212
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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))))