GNU bug report logs - #73280
30.0.90; Eglot: eglot-workspace-configuration might not be found in .dir-locals.el

Previous Next

Package: emacs;

Reported by: Troy Brown <brownts <at> troybrown.dev>

Date: Sun, 15 Sep 2024 19:55:02 UTC

Severity: normal

Found in version 30.0.90

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Troy Brown <brownts <at> troybrown.dev>, joaotavora <at> gmail.com, 73280 <at> debbugs.gnu.org
Subject: bug#73280: 30.0.90; Eglot: eglot-workspace-configuration might not be found in .dir-locals.el
Date: Mon, 16 Sep 2024 17:34:45 -0400
>> ```elisp
>> ;; Set the major mode to be the first of the managed
>> ;; modes.  This is the one the user started eglot in.
>> (setq major-mode (car (eglot--major-modes server)))
>> ```

This code is indeed hackish/heuristic by nature.

I guess the reason for it is that it needs to work regardless of the
buffers that use that server (which could all use different major
modes).

Alternatives:

- Get `eglot-workspace-configuration` "once and for all" when starting
  the server, using the major mode currently active the buffer from
  which the server's launch was triggered.
- Collect all the buffers currently using that server, take the set of
  modes they currently use, fetch the corresponding
  `eglot-workspace-configuration` values, and "merge them" (and if they
  disagree, maybe emit a warning?).

But in the mean time, it seems `eglot-workspace-configuration` was
designed so that you can have a single setting shared for all modes, as
João mentions, so using nil (or `prog-mode`) instead of `ada-mode` or
`ada-ts-mode` seems like the better option.


        Stefan





This bug report was last modified 272 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.