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 13:49:55 +0100 Message-ID: <878rgiar9o.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2449"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: 61868@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 28 13:51:31 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 1pWzS7-0000Vg-BJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 13:51:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWzRq-0002He-P9; Tue, 28 Feb 2023 07:51:16 -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 1pWzRl-0002EN-Ot for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 07:51:09 -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 1pWzRe-00056K-2h for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 07:51:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWzRd-0006vh-UG; Tue, 28 Feb 2023 07:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: joaotavora@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2023 12:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61868 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Received: via spool by submit@debbugs.gnu.org id=B.167758860326551 (code B ref -1); Tue, 28 Feb 2023 12:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Feb 2023 12:50:03 +0000 Original-Received: from localhost ([127.0.0.1]:49895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWzQh-0006uA-9V for submit@debbugs.gnu.org; Tue, 28 Feb 2023 07:50:03 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:42142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWzQg-0006ts-56 for submit@debbugs.gnu.org; Tue, 28 Feb 2023 07:50:02 -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 1pWzQf-0001my-Ls for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 07:50:01 -0500 Original-Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWzQe-0004gR-0I for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 07:50:01 -0500 Original-Received: by mail-ed1-x52e.google.com with SMTP id cq23so39537602edb.1 for ; Tue, 28 Feb 2023 04:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=b8vGc1VoKaxu/FDE8yQOkgF4Dxk/WLzXJE+jT8pqqD4=; b=NdPgCf3d8L1yml4SFkExlmj4YgXQuTve0UnVlEJdF1PgB5J3wOXU/Qw4SxYgCvOAr/ R9WgBGW52zfOEFudi1usEaSP0UPs65lOqXFwyAH36iynbwhMMsLYjNmxJwc4fbff9doq TNCJ2y8nszsvsnfSjbH5chxOEII1GdPEtig83vyltbx2WCX/9LlXXb1WXXB8Eag4BMzf apslbLghM/8M7sj2VWT8R5vSDl5PtZHAISKnjWek6pvBfNBK9scheKxZ8QhHwXKoPHB2 nc2J2qPvDN3FEj0HBwZbB8jW0DkZ3HBZuFO4T1gN3OoInmY3o5shId9U9mRuX9rvoB66 Y5RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b8vGc1VoKaxu/FDE8yQOkgF4Dxk/WLzXJE+jT8pqqD4=; b=wgI5rYJYx4l2A59HTr8Gf25lUW6sXe43mf3sRa92ZqEPotYEeVWhVm5AQi1LLGGJ2j nH6Bg5Tdy9otXI0+qvSMVqM8qgctv5ey/TxM8iU1h6UgmTzDNGCPWkhsoVgsIGe6gtzb DfAr12iERhtxSD0G2Mx3IlANTPElLhyu1MAi54JZufdSEzZqhfJDZORpzDriUvf7Hxn7 ItZbEtDidtsQdjk5vix3JoTUvP6zjT7kCZPMcF5l2/X/zOYy9riWZUwRNQAH6ZVV0K0u hewFdhfVosTq7947PIspnGVv7HEagsf1QVwPwRsoVkv+Jm0YQ89H3xWSYVN7wy0F+VH5 dlFg== X-Gm-Message-State: AO0yUKXns5asQg3jWdLeEOMwbnjFQp4NCh/3KR5jKQgoMcf55g2rfppx 8HC+pUCfuwMGPdA414NN0Vcvpfpi22mvlg== X-Google-Smtp-Source: AK7set9CXq+WySwui5YG30XWNU1bVauQ3mFUV6XGgkETNywMWeC1xFY1r1apUd/U8102kgLFnTBwmg== X-Received: by 2002:a17:906:7e5a:b0:8b1:30da:b586 with SMTP id z26-20020a1709067e5a00b008b130dab586mr2786286ejr.49.1677588597553; Tue, 28 Feb 2023 04:49:57 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::8b3a]) by smtp.gmail.com with ESMTPSA id g10-20020a50d0ca000000b004acc123cd94sm4386638edf.30.2023.02.28.04.49.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 04:49:57 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=arstoffel@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:256955 Archived-At: Arranging for Eglot to send the correct configuration via the `eglot-signal-didChangeConfiguration' command or `eglot-workspace-configuration' variable is very tricky and error prone. The following command, which reads a configuration plist from the minibuffer with history, makes this trial and error process much easier for me: (defvar eglot-edit-workspace-configuration--history nil) (defun eglot-edit-workspace-configuration () (interactive) (let* ((server (eglot-current-server)) (config (read-from-minibuffer (format "New configuration for `%s': " (eglot-project-nickname server)) (when-let ((old (eglot--workspace-configuration-plist server))) (concat "\n" (pp-to-string old))) minibuffer-local-map t 'eglot-edit-workspace-configuration--history))) (setq-local eglot-workspace-configuration config) (save-window-excursion (let ((default-directory (project-root (eglot--current-project)))) (add-dir-local-variable nil 'eglot-workspace-configuration config) (save-buffer))) (eglot-signal-didChangeConfiguration server))) 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.