emacs-languagetool / lsp-ltex

lsp-mode ❤️ LTEX
GNU General Public License v3.0
52 stars 8 forks source link

.dir-locals.el is not respected by lsp-ltex. #43

Open maikol-solis opened 3 months ago

maikol-solis commented 3 months ago

Basically, I want to use lsp-ltex in a directory with Spanish content. I put this into the .dir-local.el inside the folder

;;; Directory Local Variables            -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")

((markdown-mode . ((lsp-ltex-language . "es")
                   (ispell-local-dictionary . "spanish"))))

However, the variable lsp-ltex-language is still on "en_US"

image

How could I set the language locally?

jcs090218 commented 3 months ago

It works on my side. 🤔 This issue is regarding .dir-locals.el and not lsp-ltex. Try read https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html for more information!

maikol-solis commented 3 months ago

This very weird, I tried even with nil and it doesn't work


((nil . ((lsp-ltex-language . "es")
         (ispell-local-dictionary . "spanish"))))
maikol-solis commented 3 months ago

The only way to override the language is by calling manually (setq lsp-ltex-language "es").

jcs090218 commented 3 months ago

How did you test to see if the value is correct? Make sure you call it inside the proper buffer. 🤔