fix(elixir): let the OS files own eglot-server-programs

The shared config.el hard-coded ("expert" "--stdio"), a mac-flavoured value
from upstream c83209e, so it leaked into the Linux machine, where neither
`expert' nor language_server.sh is installed and eglot was therefore
configured with a program that cannot start.

c2f24ba claimed the Linux fallback fixed this, but it only overrides *when
it finds a server*: with nothing installed the broken shared value survived.
The correction is to remove the shared setting entirely.  config-mac.el
already configures the mac's elixir-ls, and config-linux.el's cond now means
"nothing found" leaves eglot at Emacs' default instead of pointing at a
missing binary.

config-linux.el's header comment said the shared file "used to point eglot
at a macOS path"; reword it to state that the shared file does not configure
the server at all, and why.
This commit is contained in:
Willem van den Ende
2026-11-03 13:43:11 +00:00
parent b08e48eec9
commit b425df90cf
2 changed files with 6 additions and 10 deletions
+6 -4
View File
@@ -9,10 +9,12 @@
;; checkouts in unusual places) belong in config-local.el, which is ;; checkouts in unusual places) belong in config-local.el, which is
;; gitignored -- see config-local.example.el. ;; gitignored -- see config-local.example.el.
;; Elixir language server. The shared config.el used to point eglot at a ;; Elixir language server. The shared config.el deliberately does not
;; macOS path (/Users/willem/.elixir-ls/...), which was silently dead here. ;; configure this: a single value cannot be right on both machines, and
;; Prefer `expert' if it is installed, else any elixir-ls on PATH, else ;; pointing eglot at a binary that may not exist is worse than leaving it at
;; leave eglot alone rather than configuring a server that cannot start. ;; Emacs' default. So each OS file owns it. Here: prefer `expert' if it is
;; installed, else any elixir-ls on PATH, else leave eglot alone rather than
;; configuring a server that cannot start.
(with-eval-after-load 'eglot (with-eval-after-load 'eglot
(let ((server (cond ((executable-find "expert") (let ((server (cond ((executable-find "expert")
'("expert" "--stdio")) '("expert" "--stdio"))
-6
View File
@@ -65,12 +65,6 @@
'((elixir-mode . elixir-ts-mode))) '((elixir-mode . elixir-ts-mode)))
) )
(with-eval-after-load 'eglot
(setf (alist-get '(elixir-mode elixir-ts-mode heex-ts-mode)
eglot-server-programs
nil nil #'equal)
'("expert" "--stdio")))
(use-package (use-package
elixir-ts-mode elixir-ts-mode
:hook (elixir-ts-mode . eglot-ensure) :hook (elixir-ts-mode . eglot-ensure)