ocaml: use utop and ocp-indent plugins

utop as REPL
ocp-indent for indentation
This commit is contained in:
Török Edwin 2015-04-18 19:22:03 +03:00 committed by syl20bnr
parent 60052b3168
commit 4450058b08

View file

@ -14,6 +14,8 @@
'(
tuareg
merlin
utop
ocp-indent
;; flycheck
;; flycheck-ocaml
;; package ocamls go here
@ -23,8 +25,36 @@
(add-hook 'tuareg-mode-hook #'merlin-mode)
)
(defun ocaml/init-merlin ())
(defun ocaml/opam ()
(setq opam-share (substring (shell-command-to-string "opam config var share 2> /dev/null") 0 -1))
(setq opam-load-path (concat opam-share "/emacs/site-lisp"))
(add-to-list 'load-path opam-load-path))
(defun ocaml/init-utop ()
(use-package utop
:init
(autoload 'utop "utop" "Toplevel for OCaml" t)
(autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
(add-hook 'tuareg-mode-hook 'utop-minor-mode)
:config
;; Setup environment variables using opam
(dolist (var (car (read-from-string (shell-command-to-string "opam config env --sexp"))))
(setenv (car var) (cadr var)))
;; Update the emacs path
(setq exec-path (append (parse-colon-path (getenv "PATH"))
(list exec-directory)))
)
)
(defun ocaml/init-ocp-indent ()
(use-package ocp-indent
:defer t
:init
(ocaml/opam)
)
)
(defun ocaml/init-merlin ())
;; (defun ocaml/init-flycheck-ocaml ()
;; (progn
;; (setq merlin-error-after-save nil)