You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
.emacs.d/config/flycheck/config-flycheck-cargo-has-c...

8 lines
359 B
EmacsLisp

2 years ago
(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)