Enable tuareg-mode minor modes on local-vars hooks

In time to read file/dir local variables.
This commit is contained in:
Henrik Lissner 2020-02-25 22:33:43 -05:00
parent 4c0751ca75
commit 78b4c6c5df
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -35,7 +35,7 @@
(use-package! utop (use-package! utop
:when (featurep! :tools eval) :when (featurep! :tools eval)
:hook (tuareg-mode . +ocaml-init-utop-h) :hook (tuareg-mode-local-vars . +ocaml-init-utop-h)
:init :init
(set-repl-handler! 'tuareg-mode #'utop) (set-repl-handler! 'tuareg-mode #'utop)
(set-eval-handler! 'tuareg-mode #'utop-eval-region) (set-eval-handler! 'tuareg-mode #'utop-eval-region)
@ -48,7 +48,7 @@
(use-package! merlin (use-package! merlin
:unless (featurep! +lsp) :unless (featurep! +lsp)
:hook (tuareg-mode . +ocaml-init-merlin-h) :hook (tuareg-mode-local-vars . +ocaml-init-merlin-h)
:init :init
(defun +ocaml-init-merlin-h () (defun +ocaml-init-merlin-h ()
"Activate `merlin-mode' if the ocamlmerlin executable exists." "Activate `merlin-mode' if the ocamlmerlin executable exists."
@ -97,7 +97,7 @@
(use-package! ocp-indent (use-package! ocp-indent
;; must be careful to always defer this, it has autoloads that adds hooks ;; must be careful to always defer this, it has autoloads that adds hooks
;; which we do not want if the executable can't be found ;; which we do not want if the executable can't be found
:hook (tuareg-mode . +ocaml-init-ocp-indent-h) :hook (tuareg-mode-local-vars . +ocaml-init-ocp-indent-h)
:config :config
(defun +ocaml-init-ocp-indent-h () (defun +ocaml-init-ocp-indent-h ()
"Run `ocp-setup-indent', so long as the ocp-indent binary exists." "Run `ocp-setup-indent', so long as the ocp-indent binary exists."
@ -108,7 +108,7 @@
(use-package! ocamlformat (use-package! ocamlformat
:when (featurep! :editor format) :when (featurep! :editor format)
:commands ocamlformat :commands ocamlformat
:hook (tuareg-mode . +ocaml-init-ocamlformat-h) :hook (tuareg-mode-local-vars . +ocaml-init-ocamlformat-h)
:config :config
(set-formatter! 'ocamlformat #'ocamlformat (set-formatter! 'ocamlformat #'ocamlformat
:modes '(caml-mode tuareg-mode)) :modes '(caml-mode tuareg-mode))