From 6fac8a28da9bf30da71941340505c2316d0db5a3 Mon Sep 17 00:00:00 2001 From: John Turner Date: Fri, 7 Oct 2022 03:10:21 -0400 Subject: changed the config-* prefix to init-* for all of the init files --- init/flycheck/init-flycheck-cargo-has-command-p-fix.el | 7 +++++++ init/flycheck/init-flycheck.el | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 init/flycheck/init-flycheck-cargo-has-command-p-fix.el create mode 100644 init/flycheck/init-flycheck.el (limited to 'init/flycheck') diff --git a/init/flycheck/init-flycheck-cargo-has-command-p-fix.el b/init/flycheck/init-flycheck-cargo-has-command-p-fix.el new file mode 100644 index 0000000..48d53d6 --- /dev/null +++ b/init/flycheck/init-flycheck-cargo-has-command-p-fix.el @@ -0,0 +1,7 @@ +(defun init-flycheck-rust-cargo-has-command-p (command) + (let* ((commands (process-lines "cargo" "--list")) + (trimmed (-map (lambda (row) (-slice row 4 (string-search " " 4))) commands))) + (seq-contains-p (-rest trimmed) command))) + +(advice-add 'flycheck-rust-cargo-has-command-p + :override 'init-flycheck-rust-cargo-has-command-p) diff --git a/init/flycheck/init-flycheck.el b/init/flycheck/init-flycheck.el new file mode 100644 index 0000000..ee59ef8 --- /dev/null +++ b/init/flycheck/init-flycheck.el @@ -0,0 +1,15 @@ +(require 'flycheck) + +(load "init-flycheck-cargo-has-command-p-fix") + +(add-hook 'flycheck-error-list-mode-hook (lambda () (visual-line-mode 1))) + +(add-to-list 'display-buffer-alist '("\\*Flycheck errors.*" + (init-display-buffer-best-side) + (which-side . (lambda () + (if (init-display-buffer-frame-wide-p) + 'right + 'bottom))))) + + +(provide 'init-flycheck) -- cgit v1.2.3