Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

docs(emacs): add possible gotcha

Matthew Espino45d3ce51815a
diff --git a/packages/web/src/routes/docs/integrations/emacs/+page.md b/packages/web/src/routes/docs/integrations/emacs/+page.md
index f28ed95e7..00ab54442 100644
--- a/packages/web/src/routes/docs/integrations/emacs/+page.md
+++ b/packages/web/src/routes/docs/integrations/emacs/+page.md
@@ -16,7 +16,7 @@ Since version 29, Emacs has had native support for the Language Server Protocol
'(text-mode . ("harper-ls" "--stdio"))))
```
-where `text-mode` can be set to any, some, or all major modes that correspond to the [languages `harper-ls` supports](./language-server#Supported-Languages). Typically, if you may want to use `harper-ls` to edit Markdown files and you have [`markdown-mode`](https://jblevins.org/projects/markdown-mode) installed, you can configure it like this:
+where `text-mode` can be set to any, some, or all major modes that correspond to the [languages `harper-ls` supports](./language-server#Supported-Languages). Typically, if you want to use `harper-ls` to edit Markdown files and you have [`markdown-mode`](https://jblevins.org/projects/markdown-mode) installed, you can configure it like this:
```elisp title=init.el
(with-eval-after-load 'eglot
@@ -24,6 +24,18 @@ where `text-mode` can be set to any, some, or all major modes that correspond to
'(markdown-mode . ("harper-ls" "--stdio"))))
```
+:::note
+
+A possible gotcha you may be encountering if you don't see any diagnostics is when Eglot automatically deduces the language ID being sent to `harper-ls` based on the major mode you used. In which case, you can set the language ID to one that is supported:
+
+```elisp title=init.el
+(with-eval-after-load 'eglot
+ (add-to-list 'eglot-server-programs
+ '((english-prose-mode :language-id "plaintext") . ("harper-ls" "--stdio"))
+```
+
+:::
+
## Optional Configuration
Additionally, you can also configure things like which linters to use or how you want code actions to appear. Below is an example config where everything is set to their default values: