From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#61868: 29.0.60; Eglot: setting "workspace" configurations should be easier Date: Tue, 28 Feb 2023 21:35:20 +0100 Message-ID: <87sfepa5pz.fsf@gmail.com> References: <878rgiar9o.fsf@gmail.com> <87o7pdpotl.fsf@gmail.com> 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="27999"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61868@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 Tue Feb 28 21:36:19 2023 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 1pX6hv-00079C-Gg for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 21:36:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX6hh-00009i-Am; Tue, 28 Feb 2023 15:36:05 -0500 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 1pX6he-00008h-Ip for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 15:36:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pX6he-00040e-B8 for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 15:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pX6hd-0003H5-Ol for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 15:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2023 20:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61868 X-GNU-PR-Package: emacs Original-Received: via spool by 61868-submit@debbugs.gnu.org id=B61868.167761653112548 (code B ref 61868); Tue, 28 Feb 2023 20:36:01 +0000 Original-Received: (at 61868) by debbugs.gnu.org; 28 Feb 2023 20:35:31 +0000 Original-Received: from localhost ([127.0.0.1]:52083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX6h8-0003GK-LX for submit@debbugs.gnu.org; Tue, 28 Feb 2023 15:35:30 -0500 Original-Received: from mail-ed1-f47.google.com ([209.85.208.47]:41705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX6h7-0003G8-25 for 61868@debbugs.gnu.org; Tue, 28 Feb 2023 15:35:29 -0500 Original-Received: by mail-ed1-f47.google.com with SMTP id ec43so45241239edb.8 for <61868@debbugs.gnu.org>; Tue, 28 Feb 2023 12:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lxmncFOnxodVGEmhUwF+JFr8SYFyF5xP3vyOjYRs83w=; b=MD6/+dp5dtGC07zGp9n0v5MxwCUO8wWFR41674/tBRyK5n7d3YweZp/4Z2F5tYerPq tYxsEbGP52ieaqdZ9b8ZT5PXPo0UuzP1D821Ih1ADNH6XNxs8mqXxTafYZwE5jpj2fIW iR94W2dnsP+zovfg+xG9UchieM0WQbcNxW6L3RBi+EwgN7CLPxHwDnlui5T88Rc2mcRj hvAerOPRvdtnhNIl39NRCMaeq6YfLBce7pgBc/acPGnTaPNYxGzRTmiy3867ald74Qq/ Lfz3oITQoAh11gdpiq6dw5nvrH7BvJ/pXgyfE4971Aa2RsJQ0YPbK6d3X6JwbBHDGq3Q j4VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lxmncFOnxodVGEmhUwF+JFr8SYFyF5xP3vyOjYRs83w=; b=4zvdh9f872vQ8JePbF7M2kPfGDts6BZET9P5pMLCwSA/cbRv1KvBtW9TnK7kd7SzMs L39mvtzBUenu4m7vY8EXG1etSL3SVk/7h5F+4d4ekuakRtUCaNMunKZA4ajd71f66zyC NO1MfcXALw+upD1adE3ySLRennDW9UcYGCyzLYnIhIPssMN8ZQ9udV3H7fzVM9DE8230 2J2s+59OtaAFXot/Vt2NPGiHmpCHvrG965oFhYCtkYM9Sog/KD3lqOMgvFSkTjA5Mqgt ntjQWHQByUFnC+0bJqBAgskbksJ35/EwDfiFpu1OAClzDDXt39RYrM/BXWzN0U7szZOy lPGw== X-Gm-Message-State: AO0yUKVhj4G8ULvyOquDR0KU4HH8OHFsZObCnPPVliLoNyjJfYgIT23z WBqYmQE/6ZgOaeBQVTHrAVoN2p0GcsRxBQ== X-Google-Smtp-Source: AK7set9yB2BwyavaaCZiZtKLxmeoLsqhZUVJEyapY9HGMxthStaVZF4sCBvU5rka5A4O8zAyRvBe5A== X-Received: by 2002:a17:907:d94:b0:8f4:86a9:748d with SMTP id go20-20020a1709070d9400b008f486a9748dmr6130372ejc.12.1677616522443; Tue, 28 Feb 2023 12:35:22 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::8b3a]) by smtp.gmail.com with ESMTPSA id gw26-20020a170906f15a00b008e204a57e70sm4895968ejb.214.2023.02.28.12.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 12:35:21 -0800 (PST) In-Reply-To: <87o7pdpotl.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Tue, 28 Feb 2023 19:33:42 +0000") 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:257015 Archived-At: On Tue, 28 Feb 2023 at 19:33, Jo=C3=A3o T=C3=A1vora wrote: > Augusto Stoffel writes: > >> I would suggest adding a refined version of this, using a regular buffer >> for input. Moreover, one could allow editing the configuration as a >> JSON (perhaps also retaining the option to edit as a plist). This would >> be a natural extension of the existing >> `eglot-show-workspace-configuration' command. > > I like this idea. I agree it's crazy hard to set and get right. But > this idea needs to be refined indeed. > > I'm not crazy about adding this complexity to Eglot, especially because > there's nothing really eglot-specific about it. It could be used for > any variable you want to add to the current project's root > .dir-locals.el. But that involves much more consultation in > emacs-devel. I see this differently. Emacs doesn't have deeply nested namespaces for variables and user options. It's all pretty flat, so there is almost surely never going to be a variable that is nearly as tricky to set. [ Incidentally, when I suggested to allow such syntax: ((python-mode . ((eglot-workspace-configuration . (("pylsp.plugins.jedi_completion.include_params" . t) ("pylsp.plugins.jedi_completion.fuzzy" . t) ("pylsp.plugins.pylint.enabled" . :json-false)))))) you said it was un-Lispy or something, but I really think it's rather the opposite. Emacs has flat names pretty much like the above. ] > Here's an idea. Let's make a bare-bones > eglot-show-workspace-configuration that simplifies this 80%. The other > 20% can for later. > > In the patch I sent for the other "workspace configuration" bug, the > .dir-locals.el is consulted late (actually it is even now). So a simple > implementation of eglot-edit-workspace-configuration could be just: > > (defun eglot-edit-workspace-configuration () (interactive) > (find-file (expand-file-name ".dir-locals.el" (project-root (project-= current))))) > > My bet is that that two-liner would go a long way. No, this is not enough. At the very least I need a history variable to look at the previous configurations. This feature has to be a thing on top of of `eglot-show-workspace-configuration'.