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

Please support AUCTeX new mode names out of box #4332

Open
2 of 3 tasks
ikumikeita opened this issue Feb 12, 2024 · 5 comments
Open
2 of 3 tasks

Please support AUCTeX new mode names out of box #4332

ikumikeita opened this issue Feb 12, 2024 · 5 comments
Labels

Comments

@ikumikeita
Copy link

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

I'm participating in develop of AUCTeX, Emacs TeX editing environment. Recently AUCTeX changed its major mode names as described in https://lists.gnu.org/archive/html/auctex-devel/2024-01/msg00002.html ; for example, latex-mode was renamed to LaTeX-mode. We would appreciate if you could add support for those new mode names in lsp-mode out of the box.

Steps to reproduce

Please have a look at a message sent to AUCTeX bug tracker: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69057

Expected behavior

We hope lsp-mode to work with AUCTeX new mode names out of the box.

Which Language Server did you use?

TexLab 5.12.3, but it would be independent of choice of the server.

OS

Linux

Error callstack

No response

Anything else?

I don't use lsp-mode myself. This is a request to upstream triggered by a bug report to AUCTeX development team.

@eli-tziperman
Copy link

texlab seems to work for me now under AUCtex, but lsp-grammarly does not. Perhaps this is related to this issue?

@rossedwards64
Copy link

auctex modes are still not working for me in lsp-mode, but i've been using this hack as a workaround:

(maphash (lambda (k v)
	       (let ((mode-list (lsp--client-major-modes v))
		     (tex-mode-list '(tex-mode latex-mode))
		     (auctex-mode-list '(TeX-mode LaTeX-mode)))
		 (when (and (equal k 'texlab2)
			    (cl-intersection mode-list tex-mode-list))
		   (progn
		     (dolist (mode auctex-mode-list)
		       (setf (lsp--client-major-modes v)
			     (cl-pushnew mode mode-list)))
		     (add-to-list 'lsp-language-id-configuration '(\`mode . "latex"))))))
	     lsp-clients)

@rromoli
Copy link

rromoli commented Apr 3, 2024

I still get this error even if I add the code from above LSP :: The following servers support current file but do not have automatic installation: texlab2

@rromoli
Copy link

rromoli commented Apr 3, 2024

I add LaTeX-mode to the lsp-register-client in the file lsp-tex.el ad it seems to work. I'm not elisp expert so probably my correction is trivial and perhaps not sufficient. Hope that someone more expert than me could fix it in the new version.

(lsp-register-client
 (make-lsp-client :new-connection (lsp-stdio-connection lsp-clients-texlab-executable)
                  :major-modes '(plain-tex-mode latex-mode LaTeX-mode)
                  :priority (if (eq lsp-tex-server 'texlab) 1 -1)
                  :server-id 'texlab))

@dschrempf
Copy link

This is still a problem here. I think we only need to add LaTeX-mode to the lsp-language-id-configuration.

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

No branches or pull requests

5 participants