doom|hack-local-variables => MODE-local-vars-hook

Uses a less destructive method (the same that Spacemacs uses) than the
one introduced in 13cee68, by introducing MODE-local-vars-hook hooks,
which run after local vars have been initialized.

The old method was to call `hack-local-variables` *before* mode hooks
run, however, this causes variables set by modes to have higher
precedence than local vars, which is unacceptable.

Also moved intero-mode & dante-mode to haskell-mode-local-vars-hook
This commit is contained in:
Henrik Lissner 2018-09-29 14:57:17 -04:00
parent b674aef31b
commit fd19698927
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 10 additions and 11 deletions

View file

@ -2,7 +2,7 @@
;;;###if (featurep! +dante)
(def-package! dante
:hook (haskell-mode . dante-mode)
:hook (haskell-mode-local-vars . dante-mode)
:init
(setq dante-load-flags '(;; defaults:
"+c"

View file

@ -11,7 +11,7 @@ This is necessary because `intero-mode' doesn't do its own error checks."
(if (executable-find "stack")
(intero-mode +1)
(message "Couldn't find stack. Refusing to enable intero-mode."))))
(add-hook 'haskell-mode-hook #'+haskell|init-intero)
(add-hook 'haskell-mode-local-vars-hook #'+haskell|init-intero)
:config
(setq haskell-compile-cabal-build-command "stack build --fast")
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition)