lang/elixir: conditionally install flycheck-credo

And register flycheck-credo after elixir-mode loads.
This commit is contained in:
Henrik Lissner 2018-09-01 16:17:52 +02:00
parent f52d76bccf
commit 92cfcf3627
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 7 additions and 7 deletions

View file

@ -26,7 +26,11 @@
;; the entire closure to get rid of it. ;; the entire closure to get rid of it.
(let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company))))) (let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company)))))
(remove-hook 'alchemist-mode-hook fn) (remove-hook 'alchemist-mode-hook fn)
(remove-hook 'alchemist-iex-mode-hook fn)))) (remove-hook 'alchemist-iex-mode-hook fn)))
(def-package! flycheck-credo
:when (featurep! :feature syntax-checker)
:config (flycheck-credo-setup)))
(def-package! alchemist (def-package! alchemist
@ -37,8 +41,3 @@
:documentation #'alchemist-help-search-at-point) :documentation #'alchemist-help-search-at-point)
(set-eval-handler! 'elixir-mode #'alchemist-eval-region) (set-eval-handler! 'elixir-mode #'alchemist-eval-region)
(set-repl-handler! 'elixir-mode #'alchemist-iex-project-run)) (set-repl-handler! 'elixir-mode #'alchemist-iex-project-run))
(def-package! flycheck-credo
:when (featurep! :feature syntax-checker)
:after flycheck
:config (flycheck-credo-setup))

View file

@ -4,4 +4,5 @@
;; +elixir.el ;; +elixir.el
(package! elixir-mode) (package! elixir-mode)
(package! alchemist) (package! alchemist)
(package! flycheck-credo) (when (featurep! :feature syntax-checker)
(package! flycheck-credo))