unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Troy Brown <brownts@troybrown.dev>,
	joaotavora@gmail.com, 73280@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	[thread overview]
Message-ID: <jwvwmjbi97e.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86ttefde1d.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Sep 2024 14:38:22 +0300")

>> ```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






      parent reply	other threads:[~2024-09-16 21:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-15 19:54 bug#73280: 30.0.90; Eglot: eglot-workspace-configuration might not be found in .dir-locals.el Troy Brown
2024-09-16 11:38 ` Eli Zaretskii
2024-09-16 13:48   ` João Távora
2024-09-16 17:07     ` Troy Brown
2024-09-16 18:15       ` Eli Zaretskii
2024-09-16 18:39         ` João Távora
2024-09-16 18:43           ` Eli Zaretskii
2024-09-16 18:53         ` Troy Brown
2024-09-16 19:07           ` João Távora
2024-09-16 21:34             ` Troy Brown
2024-09-16 19:17           ` Eli Zaretskii
2024-09-16 21:34   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvwmjbi97e.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73280@debbugs.gnu.org \
    --cc=brownts@troybrown.dev \
    --cc=eliz@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).