diff options
author | John Turner <jturner.usa@gmail.com> | 2022-07-03 21:29:51 -0400 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2022-07-03 21:29:51 -0400 |
commit | e6b5e17a394cc8fdd827670b8fa1a81043c8a951 (patch) | |
tree | 30754c43c34a336053f893fa26ba8bf3b1876669 /config/flycheck | |
download | emacs.d-e6b5e17a394cc8fdd827670b8fa1a81043c8a951.tar.gz |
init
Diffstat (limited to 'config/flycheck')
-rw-r--r-- | config/flycheck/config-flycheck-cargo-has-command-p-fix.el | 7 | ||||
-rw-r--r-- | config/flycheck/config-flycheck.el | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/config/flycheck/config-flycheck-cargo-has-command-p-fix.el b/config/flycheck/config-flycheck-cargo-has-command-p-fix.el new file mode 100644 index 0000000..1135165 --- /dev/null +++ b/config/flycheck/config-flycheck-cargo-has-command-p-fix.el @@ -0,0 +1,7 @@ +(defun config-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 'config-flycheck-rust-cargo-has-command-p) diff --git a/config/flycheck/config-flycheck.el b/config/flycheck/config-flycheck.el new file mode 100644 index 0000000..7478606 --- /dev/null +++ b/config/flycheck/config-flycheck.el @@ -0,0 +1,7 @@ +(require 'flycheck) + +(add-hook 'flycheck-error-list-mode-hook (lambda () (visual-line-mode 1))) + +(load "config-flycheck-cargo-has-command-p-fix") + +(provide 'config-flycheck) |