Expand Emacs documentation

Emacs 29 is now released, and include an example of enabling clippy.
This commit is contained in:
Wilfred Hughes 2023-10-15 16:34:23 -07:00
parent 6572ec8d94
commit 03bec1112a

View File

@ -237,7 +237,7 @@ To use `rust-analyzer`, you need to install and enable one of the two popular LS
==== Eglot ==== Eglot
Eglot is the more minimalistic and lightweight LSP client for Emacs, integrates well with existing Emacs functionality and will be built into Emacs starting from release 29. Eglot is the more minimalistic and lightweight LSP client for Emacs, integrates well with existing Emacs functionality and is built into Emacs starting from release 29.
After installing Eglot, e.g. via `M-x package-install` (not needed from Emacs 29), you can enable it via the `M-x eglot` command or load it automatically in `rust-mode` via After installing Eglot, e.g. via `M-x package-install` (not needed from Emacs 29), you can enable it via the `M-x eglot` command or load it automatically in `rust-mode` via
@ -246,6 +246,15 @@ After installing Eglot, e.g. via `M-x package-install` (not needed from Emacs 29
(add-hook 'rust-mode-hook 'eglot-ensure) (add-hook 'rust-mode-hook 'eglot-ensure)
---- ----
To enable clippy, you will need to configure the initialization options to pass the `check.command` setting.
[source,emacs-lisp]
----
(add-to-list 'eglot-server-programs
'((rust-ts-mode rust-mode) .
("rust-analyzer" :initializationOptions (:check (:command "clippy")))))
----
For more detailed instructions and options see the https://joaotavora.github.io/eglot[Eglot manual] (also available from Emacs via `M-x info`) and the For more detailed instructions and options see the https://joaotavora.github.io/eglot[Eglot manual] (also available from Emacs via `M-x info`) and the
https://github.com/joaotavora/eglot/blob/master/README.md[Eglot readme]. https://github.com/joaotavora/eglot/blob/master/README.md[Eglot readme].