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.devel Subject: Re: Explain a bit more on how to configure language server in Eglot's manual Date: Wed, 08 Mar 2023 21:43:35 +0100 Message-ID: <87ttyv2cug.fsf@gmail.com> References: <86sfeisu49.fsf@stephe-leake.org> <87356gvkkb.fsf@gmail.com> <87r0tz8jag.fsf_-_@gmail.com> <87lek78eyq.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="14187"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Yuan Fu , Stephen Leake , Emacs developers To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 08 21:44:20 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pa0e2-0003Xl-O7 for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Mar 2023 21:44:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pa0dS-0008Ad-SR; Wed, 08 Mar 2023 15:43:42 -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 1pa0dR-00088b-S2 for emacs-devel@gnu.org; Wed, 08 Mar 2023 15:43:41 -0500 Original-Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pa0dQ-0008Fa-65 for emacs-devel@gnu.org; Wed, 08 Mar 2023 15:43:41 -0500 Original-Received: by mail-ed1-x535.google.com with SMTP id da10so70910047edb.3 for ; Wed, 08 Mar 2023 12:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678308218; 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=fpq5trIva+Cdc4mbdnOqQm1F9v8fpWUPwPN53iywl1w=; b=SEadN8j+/nakgJZR3YAncGiZ4Wy24KYRvZEpH5JNNLthPdxq4vERGs6uaHJzBY968+ a30SRypYeN2jqBHlPQOw7z8FSwe2JEYnwS1eyri8CGxaB4d7xNy8okm6WImWg2laJ+qm lNsI7ECP+XzlkcShuyxvx37lwA79rAeLKHn1ddC8ftAaFyjboGm+96lbLTJHDEPL3PhW dcxYpZ7SJbVnYKRSbGPcGfbWNdt0GgECRBHtGaxhZaba5hkS3ZaV+STncsjAFUVw22EG kmCTPfdwkozT52flcMhZ2g98CFEsFT7Oc78ja6ryRCz9AienWvR0Ar8cJ7ZMzk7+hG+v +ROw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678308218; 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=fpq5trIva+Cdc4mbdnOqQm1F9v8fpWUPwPN53iywl1w=; b=rhAslczOqxSO+g725g40DtU6+SL7JM6iQEx4WVMn8RB2dR2LjNIkbP0NFHlzgngSX8 QMJQvW5zn/YjnzihoNX51ABfnUZEh0W5zZZEs3eFuHYvEtnT1b1HIMGREyFm9gs969GE zsWHjKXyyun9eUgIUSx6mIM7UBBN2oDQiMdPOCvcxRSl2iUPZMwyWn559xLJTPgEp8gK eiYTPAStbZtRhfF3utJDuRWNOgVCFyRWPb4fthJSvQKu7w+c1oiiDfMpr7BIX8foXXRQ sRLeWnxwR+0RcplsDUyGbJMQzYPwVF6c6aU4mLPjP6poKEB+R6NtTs5OebKVE3TKi5x8 56+Q== X-Gm-Message-State: AO0yUKUNZRNR+BqdyUN+pqrOfV/G05weCyaUdj1fZiM8a5nmxGd4Bzm0 EqWFLk1uztgNJVtbDp6N54VHFyp+JrS1ZQ== X-Google-Smtp-Source: AK7set+u2EfcD5MH9bQU/ukJRFr72NSIs7iN5mkHDok1TuIa+Hy5l0GUD4dUffe9oIccAGhR7nBnwg== X-Received: by 2002:aa7:d952:0:b0:4c6:f2cd:9d72 with SMTP id l18-20020aa7d952000000b004c6f2cd9d72mr18823542eds.5.1678308218068; Wed, 08 Mar 2023 12:43:38 -0800 (PST) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::8b3a]) by smtp.gmail.com with ESMTPSA id e21-20020a50d4d5000000b004d47ce55e57sm7049498edj.10.2023.03.08.12.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 12:43:37 -0800 (PST) In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Wed, 8 Mar 2023 19:43:11 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=arstoffel@gmail.com; helo=mail-ed1-x535.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304155 Archived-At: On Wed, 8 Mar 2023 at 19:43, Jo=C3=A3o T=C3=A1vora wrote: >> The utility function belongs to map.el. It is called `assoc-in` in >> Clojure. > > Yuri presented some pretty good arguments about how that would > be a bad idea. Also, not a Clojure expert, but AFAIK that > function doesn't take dotted notation strings as input. Of course you would need to combine it with split-string (and a dolist or seq-reduce to process a list of those dotted names). >> Speaking of bloat, and I know I shouldn't insist, but a basic version of >> the savable eglot-show-workspace-configuration barely adds 30 LOC. > > Your code has at least two big problems: > > * it takes the current value from one place and > potentially saves it in another place. This is asking > for trouble. I know you favour the 'nil' method exclusively > for setting e-w-configuration, but it's not the only supported > methods and there are configurations out in the wild that > we can't break. Also note the that per-file or per-sub-hierarchy > workspace configurations _are_supported by LSP (the scopeUri > argument to the workspace/configuration server request). Right, this is a problem. It's missing the part that will =E2=80=9Cnot con= fuse the other 10% [of users] to death=E2=80=9D, as you said. > * it doesn't take into account dir-local-set-class-variables This too. Neither the possibility of e-w-c being a function. > These are exactly the type of edge cases that I don't want > to handle in Eglot. In other words, Emacs has many variable > setting methods and making an Eglot function to oversimplify > them, even if it happens to work for an estimated majority of > cases, is a bad idea, simply because it will break a minority. Fair enough, but it seems that this multiplicity of methods basically precludes one from making a helper tool for configurations. > So I urge you to generalize your code and propose it here > in a new :core ELPA package. If you provide a function that receives a new configuration value and stores it back in the right place, then this package becomes trivial. If you don't, then this package is completely entangled with Eglot's logic for reading configs. In either case this doesn't seem to make a lot of sense as a separate package.