From fd130a9c2e5030220f5c955815fd07c58cdba747 Mon Sep 17 00:00:00 2001 From: Clement Busschaert Date: Sat, 11 Jan 2020 18:39:14 +0100 Subject: [PATCH] [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 --- modules/lang/ocaml/config.el | 5 +++++ 1 file changed, 5 insertions(+) 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))))