From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Making `eglot-server-programs' a custom variable? Date: Wed, 16 Nov 2022 14:12:39 +0000 Message-ID: <87zgcrm1ig.fsf@posteo.net> References: <86fservpri.fsf@gnu.org> <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> <83a64rggkd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8977"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, arash@gnu.org, emacs-devel@gnu.org, joaotavora@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 16 15:14:27 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 1ovJBL-00027D-Ed for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Nov 2022 15:14:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovJ9i-0001Zc-8M; Wed, 16 Nov 2022 09:12:46 -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 1ovJ9g-0001QI-JZ for emacs-devel@gnu.org; Wed, 16 Nov 2022 09:12:44 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovJ9d-0007E0-PJ for emacs-devel@gnu.org; Wed, 16 Nov 2022 09:12:44 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E3E51240028 for ; Wed, 16 Nov 2022 15:12:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1668607959; bh=UgOo25kkBt87sY6FgXkePKAr2ekfDsbMM+zeQSdDDgg=; h=From:To:Cc:Subject:Date:From; b=ljNKCVzJ01T0x4tf3qQ1+3Hw8Tmyq4nX869me8B2RBGm2UBaFmwf3mfOWXCYfRnPi kJs9LXTPNfqmIcS+G53p7ahxqasvYM36dxReBsEj59S57bKCK4mpxObCTxVJZt5opg 8gU+W7+W6A3QVQAE9EFs9Bad4JCWU0R5IRmNwhDoH91KVOcLzYWN79+3WtUCzf5/IJ rYu8xz65Jl/Mhi4V7MHSA5W4cGUT0rLNOQEUqjg1gJlpx6ZeVS/8JpuIJp6frrcvrA bzy55NCamCBb1B6CThYCPw8lEReYY9zj0+3YPeWNdg7OKx/l47uevd1cxg1si7PGzx hZjR+ftLC2/bw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NC4kZ2WvBz6tpD; Wed, 16 Nov 2022 15:12:38 +0100 (CET) In-Reply-To: <83a64rggkd.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Nov 2022 15:44:02 +0200") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:299931 Archived-At: Eli Zaretskii writes: >> 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? I believe it to be no more or less reasonable to know than how to manipulate `auto-mode-alist', and that involves Elisp regular expressions. If something like this is mentioned in the manual, I think that should suffice for a "learning-by-template" approach, which is my impression of how most people use Emacs. >> >> > 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. I don't think that either or differs too much in difficulty, this is more a question of approach.