From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Making `eglot-server-programs' a custom variable? Date: Wed, 16 Nov 2022 15:44:02 +0200 Message-ID: <83a64rggkd.fsf@gnu.org> References: <86fservpri.fsf@gnu.org> <87cz9v97lo.fsf@posteo.net> <86r0yb234t.fsf@gnu.org> <87o7te7lc7.fsf@posteo.net> <83sfioob7s.fsf@gnu.org> <87wn80zjiw.fsf@posteo.net> <83leogo9yw.fsf@gnu.org> <87r0y8zhl9.fsf@posteo.net> <83k040o8an.fsf@gnu.org> <87mt8wzf20.fsf@posteo.net> <83edu8o5gw.fsf@gnu.org> <878rkgz3nj.fsf@posteo.net> <83r0y8meis.fsf@gnu.org> <87wn7zwvqk.fsf@posteo.net> <83a64vmk8l.fsf@gnu.org> <87k03zwcpm.fsf@posteo.net> <83wn7zl2pf.fsf@gnu.org> <87fsek6ra6.fsf@posteo.net> <831qq4hyo9.fsf@gnu.org> <87fsejnj6d.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10315"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, arash@gnu.org, emacs-devel@gnu.org, joaotavora@gmail.com To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 16 14:45:50 2022 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 1ovIjc-0002Pt-To for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Nov 2022 14:45:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovIi3-0006Bq-Qe; Wed, 16 Nov 2022 08:44:11 -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 1ovIi0-0006BI-VB for emacs-devel@gnu.org; Wed, 16 Nov 2022 08:44:09 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovIhx-0006cI-Rg; Wed, 16 Nov 2022 08:44:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=rFl7yx77cp+9AqfOyau1WoL0GspSjB41/4a9U2nJVHw=; b=HoT/fD5N+ZJP 85L3UpSAFAgupGlQcd1Kww0aSrLr3rOX/2c6bpzWPqjnlnQUokBcK9TDfIexlqGZqJZfswV1c+Jmf PY4XWW47Er/T6Zh9/fQDCERaFzWy/veoBLitK+inbdnfI8NVp9oHZIR+DI3sCFEvlO6JGNVKuh39y xEfFWkl8nJGMF5prg/2yOZepLY6TwJjG3FMtWdF9pQqHgz46VVAUGGGqJXkKErPBgzrwRACAxWTFG 1ZA2oJhEm+TJUfcI3ALBuSSdM2JRmjC7FeE1umkPIqebHxF4680INKpzHFEeJLBt9de90jCdq5aaX 4WLwiIpM3xNmxMUSgHKhkQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovIhx-0005tF-0A; Wed, 16 Nov 2022 08:44:05 -0500 In-Reply-To: <87fsejnj6d.fsf@posteo.net> (message from Philip Kaludercic on Wed, 16 Nov 2022 13:05:46 +0000) 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:299926 Archived-At: > From: Philip Kaludercic > Cc: jporterbugs@gmail.com, arash@gnu.org, emacs-devel@gnu.org, > joaotavora@gmail.com > Date: Wed, 16 Nov 2022 13:05:46 +0000 > > Eli Zaretskii writes: > > > (defvar eglot-server-programs `((rust-mode . ,(eglot-alternatives '("rust-analyzer" "rls"))) > > (cmake-mode . ("cmake-language-server")) > > (vimrc-mode . ("vim-language-server" "--stdio")) > > (python-mode > > . ,(eglot-alternatives > > '("pylsp" "pyls" ("pyright-langserver" "--stdio") "jedi-language-server"))) > > ((js-json-mode json-mode) . ,(eglot-alternatives '(("vscode-json-language-server" "--stdio") ("json-languageserver" "--stdio")))) > > > > Here we have: > > > > . a multi-level list > > . elements that are alists > > . a "backquote construct" with evaluated parts in > > > > How much Lisp do we require a user to know? Imagine a user who just > > wants to add one more server, either for an existing mode or for a new > > mode not in the list. Do we really expect him or her to understand > > all that? > > For a simple modification, it appears that > > (add-to-list 'eglot-server-programs '(foo-mode "foo-lsp" "--stdio")) > > is enough. And we expect a random user to know this how? > >> > Alternatively, it requires adding infrastructure to Custom to make > >> > these aspects safer and more easily understandable (something I'm not > >> > even sure is feasible). > >> > >> Like `setopt' does with primitive type checking? > > > > Yes, but much more complex. Essentially, display the above list in a > > form that is easy to understand, and allow updating it in that form. > > I agree that that would be a good thing to have, but that appears to be > something that would require reworking the widget framework, right? Probably. Which is why I think my original proposal, not to ask users to customize such variables directly, is much easier to implement. > >> FWIW I agree that user options shouldn't be too complicated, but knowing > >> how to simplify a user option is an art in itself. > > > > Yes, but IMO we should bite that bullet every time. > > Do you mean "we" as in the Emacs core developers? Yes.