Subject: bug#61312: Patch for eglot: scala LSP binary name

From: skykanin <[email-masked]>
Date: Sun, 05 Feb 2023 21:15:48 +0000

Hello,

It seems that eglot expects the scala metals LSP server binary to be named `metals-emacs` instead of `metals`. The included patch fixes this behaviour. At least in the nix package manager the `metals` binary is simply call 'metals'. However if other package managers distribute an alias for the binary as 'metals-emacs' as well we could instead do something like:
```
(scala-mode . ,(eglot-alternatives '("metals" "metals-emacs"))
```

From 215d54ff5ee3352bcda01d88d7a167925cd8dbeb Mon Sep 17 00:00:00 2001
From: skykanin <[email-masked]>
Date: Sun, 5 Feb 2023 21:41:19 +0100
Subject: [PATCH] Patch eglot scala LSP server binary name

Ensure that eglot picks up the correct
binary name for the scala metals LSP server.
---
 lisp/progmodes/eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 4fa886bc78..ca025cf7d8 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -221,7 +221,7 @@ chosen (interactively or automatically)."
                                               "--client-id" "emacs.eglot-dart"))
                                 (elixir-mode . ("language_server.sh"))
                                 (ada-mode . ("ada_language_server"))
-                                (scala-mode . ("metals-emacs"))
+                                (scala-mode . ("metals"))
                                 (racket-mode . ("racket" "-l" "racket-langserver"))
                                 ((tex-mode context-mode texinfo-mode bibtex-mode)
                                  . ,(eglot-alternatives '("digestif" "texlab")))
-- 
2.39.0