From 033e960c94feacb1c1f0bc7b449bfa39eed9ac6c Mon Sep 17 00:00:00 2001 From: Artur Juraszek Date: Thu, 15 Nov 2018 19:48:22 +0100 Subject: [PATCH] Keyword flycheck-ocaml with :toggle instead of using a `when` --- CHANGELOG.develop | 1 + layers/+lang/ocaml/packages.el | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.develop b/CHANGELOG.develop index 6bb0b3732..606c3910f 100644 --- a/CHANGELOG.develop +++ b/CHANGELOG.develop @@ -1749,6 +1749,7 @@ Other: - Fixed issue with OPAM share directory on Windows (thanks to Levi Roth) - Enabled flycheck-ocaml (thanks to Dave Aitken) - Fixed backspace delete (thanks to Hasan Alirajpurwala) +- Fixed flycheck-ocaml not initialized warning (thanks to Artur Juraszek) **** Org - Load org-mode email integration (mu4e/notmuch) when org is loaded (thanks to Steven Allen) diff --git a/layers/+lang/ocaml/packages.el b/layers/+lang/ocaml/packages.el index b3fdf5494..9ad40c642 100644 --- a/layers/+lang/ocaml/packages.el +++ b/layers/+lang/ocaml/packages.el @@ -14,7 +14,7 @@ ;; auto-complete company flycheck - flycheck-ocaml + (flycheck-ocaml :toggle (configuration-layer/layer-used-p 'syntax-checking)) ggtags counsel-gtags helm-gtags @@ -32,18 +32,18 @@ :modes merlin-mode :variables merlin-completion-with-doc t))) -(when (configuration-layer/layer-used-p 'syntax-checking) - (defun ocaml/post-init-flycheck () - (spacemacs/enable-flycheck 'tuareg-mode)) - (defun ocaml/init-flycheck-ocaml () - (use-package flycheck-ocaml - :if (configuration-layer/package-used-p 'flycheck) - :defer t - :init - (progn - (with-eval-after-load 'merlin - (setq merlin-error-after-save nil) - (flycheck-ocaml-setup)))))) +(defun ocaml/post-init-flycheck () + (spacemacs/enable-flycheck 'tuareg-mode)) + +(defun ocaml/init-flycheck-ocaml () + (use-package flycheck-ocaml + :if (configuration-layer/package-used-p 'flycheck) + :defer t + :init + (progn + (with-eval-after-load 'merlin + (setq merlin-error-after-save nil) + (flycheck-ocaml-setup))))) (defun ocaml/post-init-ggtags () (add-hook 'ocaml-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))