From 0fd4835b8753210b4d0eaa8b8c238edf2a4d01c7 Mon Sep 17 00:00:00 2001 From: mgmarlow Date: Tue, 20 Jun 2023 17:25:43 -0700 Subject: Documentation updates --- README.md | 14 ++++++++++++-- clippy-flymake.el | 8 ++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ca459d9..1ba7606 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Use with [rust-mode](https://elpa.nongnu.org/nongnu/rust-mode.html): :hook (rust-mode . clippy-flymake-setup-backend)) ``` -## Eglot users +### Eglot users Eglot [fully manages Flymake](https://github.com/joaotavora/eglot/issues/268) so you'll need some extra code to make it cooperate: @@ -50,5 +50,15 @@ Eglot [fully manages Flymake](https://github.com/joaotavora/eglot/issues/268) so You can confirm that Flymake is running correctly by opening up a Rust buffer and examining `flymake-running-backends': ``` -Running backends: clippy-flymake, eglot-flymake-backend +Running backends: clippy-flymake-backend, eglot-flymake-backend ``` + +## Contributing + +Please contribute improvements via email to [the mailing list](https://lists.sr.ht/~mgmarlow/public-inbox) using [git send-email](https://git-send-email.io/). When posting patches, edit the `[PATCH]` line to include `clippy-flymake`: + +``` +[PATCH clippy-flymake] Add thing to stuff +``` + +Learn more about contributing via email from [Sourcehut's documentation](https://man.sr.ht/lists.sr.ht/etiquette.md). diff --git a/clippy-flymake.el b/clippy-flymake.el index 15680a3..ecfeb0d 100644 --- a/clippy-flymake.el +++ b/clippy-flymake.el @@ -58,9 +58,9 @@ (defvar-local clippy-flymake--proc nil "Clippy subprocess object, used to ensure obsolete processes aren't reused.") -(defun clippy-flymake--check-buffer (report-fn &rest _args) - "Flymake backend for cargo clippy. REPORT-FN is passed in via -`flymake-diagnostic-functions' hook. +(defun clippy-flymake-backend (report-fn &rest _args) + "Flymake backend for Clippy, the Rust linter. Calls REPORT-FN with a +list of Flymake diagnostics for the current buffer. Use `clippy-flymake-setup-backend' to register the backend with the appropriate Flymake hook." @@ -109,7 +109,7 @@ with the appropriate Flymake hook." (defun clippy-flymake-setup-backend () "Add `clippy-flymake' to `flymake-diagnostic-functions' hook." - (add-hook 'flymake-diagnostic-functions #'clippy-flymake--check-buffer nil t)) + (add-hook 'flymake-diagnostic-functions #'clippy-flymake-backend nil t)) (provide 'clippy-flymake) ;;; clippy-flymake.el ends here -- cgit v1.2.3