Open ChlorophyII opened 4 months ago
Thanks for the report. To be sure, $HOME/Documents/test.tex
is the file you're currently editing, right?
Thanks for the report. To be sure,
$HOME/Documents/test.tex
is the file you're currently editing, right?
Yes.
I'm still in the process of debugging a similar problem, but digestif
works out-of-the-box with the Emacs builtin tex-mode
but not with auctex. I switched to using a Makefile instead of trying to use the auctex build commands; I'll post the Makefile here when I finish it.
Here's the Makefile:
LATEX := latexmk -interaction=nonstopmode
all: clean-all build
build:
$(LATEX) -shell-escape -f -pdf
clean:
$(LATEX) -c
clean-all:
$(LATEX) -C
I'm no LaTeX whiz; there are probably many situations where this isn't sufficient. However, it works perfectly for the few documents I maintain, including automatic BibTeX and includes of files from subdirectories. The builtin tex-mode
plus digestif
plus this Makefile seems like a better experience than AUCTeX so far.
Confirming experiencing the same problem. Eglot+digestif gives me OP's error in auctex, but not in emacs built-in tex mode.
The problem here is most likely you use AucTeX
, that means that by default major-mode
is something like ConTeXt-mode
rather than context-mode
. Below I am using ConTeXt-mode
as an example, but adjust it to your case be it TeX-mode
or LaTeX-mode
.
If you use eglot it uses major-mode
to figure out and to send language id to the LSP server. In fact you can run something like M-x eglot-events-buffer
and see what it sends to the LSP server. If you use AucTeX
it will send ConTeXt
as a language id and thus LSP server throws an error Invalid LSP language id 'ConTeXt
.
If we look inside langserver.lua
we will see the list of languages it supports
local languageId_translation_table = {
bibtex = "bibtex",
context = "context",
doctex = "doctex",
latex = "latex",
plain = "plain",
plaintex = "plain",
["plain-tex"] = "plain",
tex = "latex", -- this is for vim; maybe "tex" should mean "tex file, undecided format"
texinfo = "texinfo"
}
The problem could be resolved by sending a correct language id to the LSP server. If you are using eglot you are in luck. You can specify a property for the symbol of the major mode you are in like so
(put 'ConTeXt-mode 'eglot-language-id "context")
Now you can reconnect eglot and it should work
I am not sure whether it is a corfu problem or a digestif problem, but corfu works fine with other languages, together with Eglot. Here is a minimal config and tex file to reproduce the error. The error appears when corfu tries completion, after typing a few characters.
Error message:
With debug-on-error:
Versions: OS: macOS Sonoma 14.3.1 (23D60) Emacs: 29.2 Corfu: 1.2 Eglot: 1.12.29 digestif: 0.5.1-1
Any insight in how this may be resolved?