From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Troy Brown 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 13:07:15 -0400 Message-ID: References: <86ttefde1d.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8899"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Stefan Monnier , 73280@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 16 19:08:10 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 1sqFCr-00026Z-HM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Sep 2024 19:08:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqFCl-0001iO-15; Mon, 16 Sep 2024 13:08:03 -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 1sqFCX-0000xe-PW for bug-gnu-emacs@gnu.org; Mon, 16 Sep 2024 13:07:50 -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 1sqFCX-0000JB-GX for bug-gnu-emacs@gnu.org; Mon, 16 Sep 2024 13:07:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=3an15VdY5qgI6oHqcfzK/k+INAxPQRzttr98l1yMwzc=; b=k26/pDn2h2awVEmsJ9axkXQhXy5kycVvWHzZbNdrdwZ50svE2ni9/LCTCfZqwJarCJ5O0TTgnlaKlP/+tANNiIVk5R09Ji6JYungfTvfLutMrUcVPwwzL7zZL5LrRGUYM9VMrXXjIVL/Ma+524on9CkLZBHgzaxdGuOy7RztQwKr66cMf3kKvr61wBK6MHHpoUd7SdFLq7E/HbFYi9ruRDzNX53K7VcKvxnZzTMfIYZdL5CsFuNskhRjsaFFenduPJlpv6x7z7kPjBIXc320dLp9Rd/ssBTw6QNDui1bTdBWDap8EjBS+MoKUikMrUmWpdf4rIdYY9wiWctHw/199g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sqFCk-0003pa-M2 for bug-gnu-emacs@gnu.org; Mon, 16 Sep 2024 13:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Troy Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Sep 2024 17:08: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.172650647114700 (code B ref 73280); Mon, 16 Sep 2024 17:08:02 +0000 Original-Received: (at 73280) by debbugs.gnu.org; 16 Sep 2024 17:07:51 +0000 Original-Received: from localhost ([127.0.0.1]:53182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqFCY-0003p0-Be for submit@debbugs.gnu.org; Mon, 16 Sep 2024 13:07:50 -0400 Original-Received: from mail-lj1-f182.google.com ([209.85.208.182]:47469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqFCW-0003oj-Co for 73280@debbugs.gnu.org; Mon, 16 Sep 2024 13:07:49 -0400 Original-Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2f75b13c2a8so52567781fa.3 for <73280@debbugs.gnu.org>; Mon, 16 Sep 2024 10:07:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726506448; x=1727111248; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3an15VdY5qgI6oHqcfzK/k+INAxPQRzttr98l1yMwzc=; b=q4a1IRqN4tl2Dd0tNRqSDjftJFzKnjs7ksE2StYf4O+HCYmgY1Ao+xsnSL3mA64q09 GWccB4IXR5APQXMQ5VRrRoI1Alw/NkS6LKFAKZb1ehsKchfTO7DO5Zd6oobiKvkt1xIT 0RepklkN1MzC1ktDybcFaXLL61Me/IOEzqv+FxpMB8V1hMw4ZxzmgvQ0EjmnBFlAXr41 NnnZuFqdDywWDRzP9/0lkfmCms2KjUgnaNLsfZH+GYYlEjduX1sYhHbV+9jt5qSsYWk/ oTuKNuegpupEbhiFKPcc0gh/kX42KLPW+mMBJKwz5Ei2Zt5uZ3sbZ+RgGP8GIVFIFl8F b1wg== X-Forwarded-Encrypted: i=1; AJvYcCWHjPhGor6GBk6Iusq4yIiRY2NyZOGQ3fhseQ7vRscR+IPQYWSeTKHtIYiy5DPtoyUfDtm2ww==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywn9+FUavWCdAfFFN77CaOAMiwDdrkDS0e9T2q0DbK5G/JyJpCF I5ObhsNL1Mv6DJ82DTy12Ee1fmUl6R+k4dLeMXSgvqRe94HA3uVeNMB+kSV2A9Y= X-Google-Smtp-Source: AGHT+IESdBY+I76iP4IjkOWI8krl9HDj+WrpMcgFZT4ocLXYUUYcsE+d352skga77TqWoO6l8FTewg== X-Received: by 2002:a05:651c:1990:b0:2ef:2b06:e554 with SMTP id 38308e7fff4ca-2f787dbf3eemr89079721fa.15.1726506447310; Mon, 16 Sep 2024 10:07:27 -0700 (PDT) Original-Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com. [209.85.208.43]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c42bb8c143sm2787902a12.68.2024.09.16.10.07.26 for <73280@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Sep 2024 10:07:26 -0700 (PDT) Original-Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5c4226a56a8so3953111a12.2 for <73280@debbugs.gnu.org>; Mon, 16 Sep 2024 10:07:26 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUAdjKpDPPLZKCg9oCjq/OPI1Eaeb87mS2QJpeTCmUtxUi9JyTIrPT01jfieVb+CMg+VQ4Q1g==@debbugs.gnu.org X-Received: by 2002:a05:6402:388e:b0:5c0:c6ab:7c0f with SMTP id 4fb4d7f45d1cf-5c413e4c6b4mr14044712a12.23.1726506446398; Mon, 16 Sep 2024 10:07:26 -0700 (PDT) In-Reply-To: X-Gmail-Original-Message-ID: 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:291900 Archived-At: On Mon, Sep 16, 2024 at 9:48=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: > > On Mon, Sep 16, 2024 at 12:38=E2=80=AFPM Eli Zaretskii wro= te: > > > Jo=C3=A3o and Stefan, any comments? > > > > FWIW, I'd rather think this is a feature, since users don't need > > separate Eglot settings for ada-mode and ada-ts-mode. But maybe I'm > > missing something. > > You didn't miss that much. This is half-feature, half > headache-I-didn't-want-to-worry-about. So I put int the 'car' > on purpose. The first of the modes listed in a e-s-programs entry > is usually the most representative one of the language, more or less. > > Is there a downside to mentioning a major mode you don't > actually use in your .dir-locals.el, Troy? > I would say the major downside is that it is not intuitive at all. It's not consistent with how directory-local variables behave. When I saw that the variable was set locally in my buffer but that the configuration wasn't actually applied to the server, I had to dig into this and understand what was going on. I have to imagine anyone else using this would be just as stumped as I was when it wasn't working. I don't think I'd agree with the first mode being representative, it seems somewhat arbitrary. For instance, in order to change eglot-workspace-configuration for "sh-mode", you have to set the configuration in .dir-locals.el for "bash-ts-mode"...who would've guessed this? Just looking through the lists of modes corresponding to the same server, I don't think people would normally make this connection, and the fact that it doesn't work the same way that directory-local variables do, makes it even more unexpected and confusing. What about having eglot--workspace-configuration-plist cycle through the list of modes for the server until it finds a non-nil eglot-workspace-configuration, or has scanned them all? This would seem like a better approach since it will at least find a configuration if one exists, rather than ignoring an existing configuration. I don't know if that would be considered too CPU intensive or not. It's still not the same behavior as a directory local variable, but I think it would be an improvement over the current behavior.