mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-18 16:06:56 -05:00
Merge pull request #4842 from rgrinberg/fix-ocamlformat
ocamlforamt hook: buffers without a file name
This commit is contained in:
@@ -111,9 +111,10 @@
|
|||||||
(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)))
|
(when buffer-file-name
|
||||||
(cond ((equal ext ".eliom")
|
(let ((ext (file-name-extension buffer-file-name t)))
|
||||||
(setq-local ocamlformat-file-kind 'implementation))
|
(cond ((equal ext ".eliom")
|
||||||
((equal ext ".eliomi")
|
(setq-local ocamlformat-file-kind 'implementation))
|
||||||
(setq-local ocamlformat-file-kind 'interface))))
|
((equal ext ".eliomi")
|
||||||
|
(setq-local ocamlformat-file-kind 'interface)))))
|
||||||
(setq +format-with 'ocamlformat))))
|
(setq +format-with 'ocamlformat))))
|
||||||
|
Reference in New Issue
Block a user