From d2db11a63041bb9b9e2d185f87b9478fcc1a81df Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Thu, 19 Jan 2023 23:50:41 +0100 Subject: Fix flymake-collection setup --- tw/home/files/emacs-init.el | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'tw/home') diff --git a/tw/home/files/emacs-init.el b/tw/home/files/emacs-init.el index 648875cd..2e4ff9f9 100644 --- a/tw/home/files/emacs-init.el +++ b/tw/home/files/emacs-init.el @@ -192,22 +192,27 @@ (use-package flymake :after (evil which-key) + :demand t ; needed for `flymake-collection' :hook prog-mode :init (which-key-add-key-based-replacements "e" '("errors" . "Flymake")) :bind (("eb" . flymake-start) - ("el" . flymake-show-buffer-diagnostics) - ("ep" . flymake-show-project-diagnostics) - ("e." . display-local-help) ; Show the error message at point in the minibuffer. + ("ec" . display-local-help) ; Show the error message at point in the minibuffer. ; `flymake' also shows it using `eldoc', but documentation ; seems to override error messages. + ; `flymake-show-diagnostic' only says "Nothing at point". + ("el" . flymake-show-buffer-diagnostics) + ("ep" . flymake-show-project-diagnostics) ("en" . flymake-goto-next-error) - ("eN" . flymake-goto-prev-error)) + ("eN" . flymake-goto-prev-error) + ("ev" . flymake-running-backends) + ("eV" . flymake-disabled-backends)) :custom (flymake-suppress-zero-counters nil "Show severity counters even when they are zero.")) (use-package flymake-collection :after (flymake) + :demand t ; we need it loaded now ;; This needs to be called in `after-init-hook' so that all other ;; packages' `:flymake-hook's are processed before f-c-hook-setup is ;; called. See https://github.com/mohkale/flymake-collection. @@ -251,9 +256,19 @@ :mode (rx ".pp" eos)) (use-package python + :after (flymake-collection) :commands (python-mode) :mode (((rx ".py" (? (or ?\i ?\w)) eos) . python-mode) - ((rx ".aurora" eos) . python-mode))) + ((rx ".aurora" eos) . python-mode)) + ;; :flymake-hook would be better, but it fails with error: (void-variable + ;; for). Somehow `cl-loop' is getting parsed wrong... + ;; https://github.com/mohkale/flymake-collection#associating-checkers-with-major-modes + :init (add-to-list 'flymake-collection-config + '(python-mode + flymake-collection-flake8 + flymake-collection-mypy + (flymake-collection-pycodestyle :disabled t) + flymake-collection-pylint))) (use-package rec-mode :mode (rx ".rec" eos)) -- cgit v1.2.3