diff options
| author | Michael Herstine <sp1ff@pobox.com> | 2023-07-29 10:07:34 -0700 |
|---|---|---|
| committer | mgmarlow <graham@mgmarlow.com> | 2023-07-29 12:16:40 -0700 |
| commit | acc01baff5d295c3ada79da191473f24e43c3705 (patch) | |
| tree | 959052561c956d75698bc3d6d90b96cd53da1517 /README.md | |
| parent | 08306ca825a51fced86e1ec07b4e927c0194ca21 (diff) | |
| download | flymake-clippy-acc01baff5d295c3ada79da191473f24e43c3705.tar.gz | |
Update the README with more recent instructions
The README contained two things that were incorrect for my setup
(Emacs from source (30+) and elgot 1.15):
- `use-package' now has support for fetching from git, albeit
with different parameters
- `eglot--managed-mode-hook' was deprecated some time ago (in
eglot 1.6)-- one should use `eglot-managed-mode-hook' now.
This patch updates the README, preserving the old documentation,
but adding the above information.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 38 |
1 files changed, 36 insertions, 2 deletions
@@ -6,7 +6,7 @@ A Flymake backend for [Clippy](https://doc.rust-lang.org/stable/clippy/index.htm You probably want to install [rust-mode](https://github.com/rust-lang/rust-mode) first. -With Emacs 29: +With Emacs 29 and [vc-use-package](https://github.com/slotThe/vc-use-package): ```elisp (use-package clippy-flymake @@ -14,6 +14,14 @@ With Emacs 29: :hook (rust-mode . clippy-flymake-setup-backend)) ``` +With Emacs 30: + +``` elisp +(use-package clippy-flymake + :vc (:url "https://git.sr.ht/~mgmarlow/clippy-flymake" :branch main) + :hook (rust-mode . clippy-flymake-setup-backend)) +``` + Alternatively, clone the repo and update your load path: ``` @@ -38,9 +46,11 @@ Eglot users require [a little extra setup](https://github.com/joaotavora/eglot/i (add-hook 'flymake-diagnostic-functions #'eglot-flymake-backend nil t) (flymake-mode 1)) -(add-hook 'eglot--managed-mode-hook #'manually-activate-flymake nil t) +(add-hook 'eglot-managed-mode-hook #'manually-activate-flymake nil t) ``` +(Nb. prior to eglot 1.6, this hook was called `eglot--managed-mode-hook) + You can confirm that Flymake is running correctly by opening up a Rust buffer and examining `flymake-running-backends': ``` @@ -51,6 +61,8 @@ Running backends: clippy-flymake-backend, eglot-flymake-backend ### Complete eglot + rust-mode + use-package example +Prior to emacs 30 for the `:vc` specification, and prior to eglot 1.6 for the minor mode hook: + ```elisp (use-package rust-mode :ensure t) @@ -71,6 +83,28 @@ Running backends: clippy-flymake-backend, eglot-flymake-backend (add-to-list 'eglot-stay-out-of 'flymake)) ``` +Emacs 30, eglot 1.6+: + +```elisp +(use-package rust-mode + :ensure t) + +(use-package clippy-flymake + :vc (:url "https://git.sr.ht/~mgmarlow/clippy-flymake" :branch main) + :hook (rust-mode . clippy-flymake-setup-backend)) + +(defun manually-activate-flymake () + (add-hook 'flymake-diagnostic-functions #'eglot-flymake-backend nil t) + (flymake-mode 1)) + +(use-package eglot + :ensure t + :hook ((rust-mode . eglot-ensure) + (eglot-managed-mode . manually-activate-flymake)) + :config + (add-to-list 'eglot-stay-out-of 'flymake)) +``` + ## Contributing Please direct bug reports or patches to the [the mailing list](https://lists.sr.ht/~mgmarlow/public-inbox). |
