Add ReasonML

This commit is contained in:
Maciej 2020-04-09 14:36:15 +03:00
parent 810d175372
commit d2e4c202b0
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
11 changed files with 66 additions and 42 deletions

21
languages/reason.el Normal file
View file

@ -0,0 +1,21 @@
(use-package merlin
:defer t
:ensure t)
(use-package reason-mode
:defer t
:ensure t
:config (setq refmt-command 'opam))
(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share")))))
(when (and opam-share (file-directory-p opam-share))
;; Register Merlin
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
(autoload 'merlin-mode "merlin" nil t nil)
;; Use opam switch to lookup ocamlmerlin binary
(setq merlin-command 'opam)))
(add-hook 'reason-mode-hook
(lambda ()
(add-hook 'before-save-hook #'refmt-before-save)))
(add-hook 'reason-mode-hook 'merlin-mode)