From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <86ttefde1d.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16673"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Troy Brown , joaotavora@gmail.com, 73280@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 16 23:36:05 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sqJO8-0004CN-2z for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Sep 2024 23:36:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqJNy-000580-FC; Mon, 16 Sep 2024 17:35:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqJNs-00057Y-Sj for bug-gnu-emacs@gnu.org; Mon, 16 Sep 2024 17:35:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqJNs-0006Js-HX for bug-gnu-emacs@gnu.org; Mon, 16 Sep 2024 17:35:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=IfAziStB44Lx/ZCH/ebR8XsrVD173kRrlVl9I0QMZdY=; b=AXX0f1ULNiYASZtGr490dYQ3XWKM0/rjW7bM3kYQk534N662ioXvmuXCeXEGAerQ/rTulg9gcDWF3JOJCPubiLDy0wzrmdM0YF4d9W1lZT6DExbC8mNf/gUezfuFSa/DVs8jcbhQ+kke463U+ihp+YsjNTJHgQTFLHXNVKfpZvfY826TmNcBsYVwOGSPDr33W9UP9GnaXY/eUswIij1E00eZgJlAu1ISb0wKuVoBWssTD390CIhGhEGt76CNdjQpQslCooS2zhE24rnah7S9HsfffbIgOo2embm22uB4YL0VZV14XOitLahQrGOHLz033mdqPbi7V1Zn+w36ErWKOQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sqJO6-0001yh-8F for bug-gnu-emacs@gnu.org; Mon, 16 Sep 2024 17:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Sep 2024 21:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73280 X-GNU-PR-Package: emacs Original-Received: via spool by 73280-submit@debbugs.gnu.org id=B73280.17265225107038 (code B ref 73280); Mon, 16 Sep 2024 21:36:02 +0000 Original-Received: (at 73280) by debbugs.gnu.org; 16 Sep 2024 21:35:10 +0000 Original-Received: from localhost ([127.0.0.1]:53508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqJNG-0001pR-2G for submit@debbugs.gnu.org; Mon, 16 Sep 2024 17:35:10 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqJNE-0001pA-HD for 73280@debbugs.gnu.org; Mon, 16 Sep 2024 17:35:08 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AD5154450F4; Mon, 16 Sep 2024 17:34:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1726522486; bh=b47tPLJ05sGMsGz2N/N4alUPNO0C1cJ+7TDmlcaplS8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bdGVtu4DQDyYKlvsdtIB+zm2hzoIxM5xYHRmnN3LD/gN+D7OrQXEsJMGwXeoK8YbO JeLn4LLgtzKh7tE/+YvhdFgbFS9SeDsMdLaBNU5PSbkp1+cjFhyeYgi89FZk2SXzoj dzbqkg2D2JQ1GbkVbReKVSrtXncBfqPcOJ6xBhHo6exXkZKwUkloJjwIy4DaLXutDE gUa3+XB+9qg6BQf0Pm2d/qX6JHS+7LFKBy+snbbV/ivax3QYvML6g0bELB8GyoGeo0 LbVzGEXOe6ubUSjR6viWqwfhZwllB0fieWafgzWIvapxZ0RbjeFkP5c0pt7AQomsoK CvqH4JsAKO0Pw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EE03D4450DA; Mon, 16 Sep 2024 17:34:45 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DC4DC12051B; Mon, 16 Sep 2024 17:34:45 -0400 (EDT) In-Reply-To: <86ttefde1d.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Sep 2024 14:38:22 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291918 Archived-At: >> ```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=E3o mentions, so using nil (or `prog-mode`) instead of `ada-mode` or `ada-ts-mode` seems like the better option. Stefan