A hook to latex-mode doesn't trigger eglot ensure #1340
-
Hi! I'm using doom-emacs, and I want to trigger eglot in latex mode automatically. I have this in my config:
However, it doesn't work. Checking a little of the eglot code, my best guess is in this line it's missing https://github.com/emacs-straight/eglot/blob/978497f4ba22373f7ef3c0ce3008d945bda98430/eglot.el#L266 Best. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
https://joaotavora.github.io/eglot/#Starting-Eglot Especially the second part. Try with |
Beta Was this translation helpful? Give feedback.
-
Wild guess, but did you have AUCTeX installed? I had the same problem and found this question while looking for a solution. At first, the only way I could get Eglot to start was to uninstall AUCTeX. So I ended up looking through the code to find out what's going on. Turns out that AUCTeX replaces the function cells of both However the replaced modes do run |
Beta Was this translation helpful? Give feedback.
Using the default setting didn't trigger any warning or error.
However, I tried this
And now eglot is triggered automatically by the
add-hook
part.I am just random guessing here (I don't know the internals in latex-mode). But, maybe the problem is when
tex-mode
is called, the default mode for the file islatex-mode
and at this point there isn't any server assigned for that mode. So eglot skipped it in theeglot-server-programs
list.In any case, the line I showed before solves the problem.
Thanks.