Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activating lsp-ltex in other modes #42

Open
wehlutyk opened this issue Mar 5, 2024 · 3 comments
Open

Activating lsp-ltex in other modes #42

wehlutyk opened this issue Mar 5, 2024 · 3 comments

Comments

@wehlutyk
Copy link

wehlutyk commented Mar 5, 2024

First of all thanks for lsp-ltex!

I got it running in mu4e's mu4e-compose-mode on doomemacs with the following steps:

Before (use-package! lsp-ltex ...), pre-defining lsp-ltex-active-modes makes lsp-ltex take the change. In my case:

(defcustom lsp-ltex-active-modes
  '(text-mode
    bibtex-mode context-mode
    latex-mode LaTeX-mode ;; AUCTeX 14+ has renamed latex-mode to LaTeX-mode
    markdown-mode org-mode
    rst-mode
    mu4e-compose-mode)
  "List of major mode that work with LTEX Language Server."
  :type 'list
  :group 'lsp-ltex)

At that point lsp works when composing, with the following warning:

Warning (lsp-mode): Unable to calculate the languageId for buffer ‘XXX’. Take a look at ‘lsp-language-id-configuration’. The ‘major-mode’ is mu4e-compose-mode

So adding

(after! lsp-ltex
  (appendq! lsp-language-id-configuration
            '((mu4e-compose-mode . "plaintext"))))

gets that solved.

Could there be a more generic setting for the list of modes activated?

@jcs090218
Copy link
Member

Not as I am aware of. The closest thing I can think of is going through lsp-activate-on. 🤔

@wehlutyk
Copy link
Author

wehlutyk commented Mar 7, 2024

Could that change the user config into a one-liner? It's okay as it is otherwise, I can close this.

@jcs090218
Copy link
Member

No, unfortunately. I'll return to this thread once I figure out how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants