From ab8430055d1e3f683ab81f9f79699652c0ee2722 Mon Sep 17 00:00:00 2001 From: Sven Bartscher Date: Mon, 7 Nov 2022 21:09:18 +0100 Subject: [PATCH 1/2] Fix argument handling in `rustic-cargo-clippy-rerun` This fixes a bug wgere `rustic-cargo-clippy-rerun` did not pass any effective arguments to `rustic-cargo-clippy-run`, so the resulting run would always have no arguments. --- rustic-clippy.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustic-clippy.el b/rustic-clippy.el index 2dbb6b54..8bc1efb0 100644 --- a/rustic-clippy.el +++ b/rustic-clippy.el @@ -92,7 +92,7 @@ When calling this function from `rustic-popup-mode', always use the value of (defun rustic-cargo-clippy-rerun () "Run 'cargo clippy' with `rustic-clippy-arguments'." (interactive) - (rustic-cargo-clippy-run rustic-clippy-arguments)) + (rustic-cargo-clippy-run :params rustic-clippy-arguments)) (defun rustic-cargo-clippy-fix (&rest args) "Run 'clippy fix'." From e57139d4f97ad3800a7307688d4a09e5a3623e66 Mon Sep 17 00:00:00 2001 From: Sven Bartscher Date: Mon, 7 Nov 2022 22:05:32 +0100 Subject: [PATCH 2/2] Always set `rustic-clippy-arguments` in `rustic-cargo-clippy` This means that running `rustic-cargo-clippy-rerun` would use the same arguments, even when `rustic-default-clippy-arguments` were used. --- rustic-clippy.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/rustic-clippy.el b/rustic-clippy.el index 8bc1efb0..7a309a1e 100644 --- a/rustic-clippy.el +++ b/rustic-clippy.el @@ -78,15 +78,16 @@ If ARG is not nil, use value as argument and store it in `rustic-clippy-argument When calling this function from `rustic-popup-mode', always use the value of `rustic-clippy-arguments'." (interactive "P") - (rustic-cargo-clippy-run - :params (cond (arg - (setq rustic-clippy-arguments (read-from-minibuffer "Cargo clippy arguments: " rustic-default-clippy-arguments))) - ((eq major-mode 'rustic-popup-mode) - (if (> (length rustic-clippy-arguments) 0) - rustic-clippy-arguments - rustic-default-clippy-arguments)) - (t - rustic-default-clippy-arguments)))) + (setq rustic-clippy-arguments (cond + (arg + (read-from-minibuffer "Cargo clippy arguments: " rustic-default-clippy-arguments)) + ((eq major-mode 'rustic-popup-mode) + (if (> (length rustic-clippy-arguments) 0) + rustic-clippy-arguments + rustic-default-clippy-arguments)) + (t + rustic-default-clippy-arguments))) + (rustic-cargo-clippy-run :params rustic-clippy-arguments)) ;;;###autoload (defun rustic-cargo-clippy-rerun ()