From 67082e77e30aac0017bf137bba5c9647098cf883 Mon Sep 17 00:00:00 2001 From: Geoff Shannon Date: Thu, 11 Dec 2014 10:58:47 -0500 Subject: [PATCH 1/2] Setup the new flycheck-ocaml syntax checker --- modules/prelude-ocaml.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/prelude-ocaml.el b/modules/prelude-ocaml.el index 68df75c..28cca42 100644 --- a/modules/prelude-ocaml.el +++ b/modules/prelude-ocaml.el @@ -49,7 +49,7 @@ ;;; Code: -(prelude-require-packages '(tuareg utop merlin)) +(prelude-require-packages '(tuareg utop merlin flycheck-ocaml)) (require 'tuareg) (require 'utop) @@ -60,8 +60,15 @@ ("\\.topml\\'" . tuareg-mode)) auto-mode-alist)) -(add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer) -(add-hook 'tuareg-mode-hook 'merlin-mode) +(with-eval-after-load 'merlin + ;; Disable Merlin's own error checking + (setq merlin-error-after-save nil) + + ;; Enable Flycheck checker + (flycheck-ocaml-setup)) + +(add-hook 'tuareg-mode-hook #'utop-setup-ocaml-buffer) +(add-hook 'tuareg-mode-hook #'merlin-mode) (add-hook 'tuareg-mode-hook (lambda () (progn From 1011fccaba13b0f7306f7228465212f04b94f6fa Mon Sep 17 00:00:00 2001 From: Geoff Shannon Date: Thu, 11 Dec 2014 11:00:31 -0500 Subject: [PATCH 2/2] Update default opam commands to newest syntax Newer versions of opam don't do argument parsing of the first argument after `opam config exec` so everything needs to be passed as separate arguments in the shell (i.e. unquoted). --- modules/prelude-ocaml.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/prelude-ocaml.el b/modules/prelude-ocaml.el index 28cca42..c3da0cc 100644 --- a/modules/prelude-ocaml.el +++ b/modules/prelude-ocaml.el @@ -75,7 +75,7 @@ (define-key tuareg-mode-map (kbd "C-c C-s") 'utop) (setq compile-command - "opam config exec \"corebuild \"")))) + "opam config exec corebuild ")))) ;; Setup merlin completions company is used by default in prelude (add-to-list 'company-backends 'merlin-company-backend) @@ -84,7 +84,7 @@ ;; to activate it. ;; (setq merlin-use-auto-complete-mode t) -(setq utop-command "opam config exec \"utop -emacs\"" +(setq utop-command "opam config exec utop -- -emacs" merlin-error-after-save nil) (provide 'prelude-ocaml)