From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: Making `eglot-server-programs' a custom variable? Date: Thu, 10 Nov 2022 18:56:01 +1100 Message-ID: <865yfndy14.fsf@gmail.com> References: <86fservpri.fsf@gnu.org> <831qqbtixr.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="14993"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.1; emacs 29.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 10 09:17:23 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 1ot2kU-0003i0-OZ for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Nov 2022 09:17:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot2kJ-0003zo-Ve; Thu, 10 Nov 2022 03:17:12 -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 1ot2kD-0003z0-O9 for emacs-devel@gnu.org; Thu, 10 Nov 2022 03:17:07 -0500 Original-Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot2kA-0003Eh-CK for emacs-devel@gnu.org; Thu, 10 Nov 2022 03:17:05 -0500 Original-Received: by mail-pg1-x530.google.com with SMTP id q71so1081986pgq.8 for ; Thu, 10 Nov 2022 00:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:to:from:user-agent :references:from:to:cc:subject:date:message-id:reply-to; bh=jYcoqa2DoQZ9dISUXFEK/Vsa/Y6BaUYwz7LOILfOShA=; b=pHrGu6iZtb4DKF9Ub2bt7Mkt/MWhvuNkPbe+REuKyDvLWDhf11OKF90aJOrfbusaZq WYU/KGOeVhuN0AKYuRZ1XunqtG5we/0CTU6mBfPirG/kM5PLgxCK0rBI00gOnXn/Ca1u VLa6kq68DSlD+qTM2AuGp52yeLofm8PZiHJu2utiQkCH3qiQSG5HOfSGrybZpzJMQl98 KcPHKbQdc8zJrdIiua3/a01MMiGPf1mssmfHpkMF3wSy8Bn5DFN9F+DuFsLANK53o8GR OPTOFFLcGMPUyvoCnRF/O7Dbj+ROp+vyEdSRzDBhI6jtfEO50xA4QEEFVDB84xzF37pu w5lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:to:from:user-agent :references:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jYcoqa2DoQZ9dISUXFEK/Vsa/Y6BaUYwz7LOILfOShA=; b=Ol+YZO8xoyTRJK5XWO8xVFsYEGsWwHIc5PjhaWi5ERECmTKBl0fIWg/ZjeMMRzibjR xSGVObtY+w10v6HR9V/5aMA6NzqDJ8qVdA9pS2ICo/Bhb5xHdgsL2HMkUF22vNJDiSRP by9G8BkQubQK74sLsqjLuKb2f8alZcAwv5miuuyCw7f5suiAjRqx9CxRtEGTtq+esr2X 3w9EVn3ZJPe64SKVAY9BdTTe8Yx6G1NaKaBLlLwbSq9m4iu5rxcJmXCJjl594a8GSWuA hTQxAe0B0DInJpVl+lWnLV2fpX3TPTxeu1+lbrJaSHPfDly8HccHajFtDUJi+WzuPmC2 NGzg== X-Gm-Message-State: ACrzQf3AVdmS8iz66cH3piwsIMMmg8KUyD48yH0pICxUS0fF8OGz2tlj sQzae5Pq8rm69l0+EjUvJPKOGRv4KF8= X-Google-Smtp-Source: AMsMyM7ulryORKMt9PpyvZxX8jcvPPTff/j6LXDmRbKX+SnvoibzN83NjdqAT+Q2D3F3DLz7UIFo5w== X-Received: by 2002:a62:32c2:0:b0:56b:2cce:d46a with SMTP id y185-20020a6232c2000000b0056b2cced46amr63299793pfy.36.1668068219777; Thu, 10 Nov 2022 00:16:59 -0800 (PST) Original-Received: from dingbat (220-235-181-183.dyn.iinet.net.au. [220.235.181.183]) by smtp.gmail.com with ESMTPSA id g13-20020a17090a4b0d00b001f262f6f717sm2546131pjh.3.2022.11.10.00.16.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 00:16:59 -0800 (PST) In-reply-to: <831qqbtixr.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=theophilusx@gmail.com; helo=mail-pg1-x530.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:299463 Archived-At: Eli Zaretskii writes: >> From: Arash Esbati >> Date: Wed, 09 Nov 2022 21:25:53 +0100 >> >> I tried eglot only once and I had to add a lsp-server to >> `eglot-server-programs'. From this experience, is there a plan to make >> this a custom variable? If not, I suggest to change the example in >> eglot manual from >> >> (add-to-list 'eglot-server-programs >> '(foo-mode . ("fools" "--stdio"))) >> >> to >> >> (with-eval-after-load 'eglot >> (add-to-list 'eglot-server-programs >> '(foo-mode . ("fools" "--stdio")))) >> >> for those who will copy&paste this into their init files and then wonder >> why it throws an error. > > The intent is for this variable to include enough servers to make it > unnecessary to add to the list. With that in mind, I wouldn't > complicate the manual by making sure this is copy/paste-able. > > Is the LSP server you needed to add still missing from the database > currently on master? If so, please suggest the addition(s). I'm not sure that intent will hold. It has the underlying assumption there is a definitive language server for each language. There are multiple servers for many languages and individual preferences/requirements can differ. The first thing I had to do in order to use eglot was modify this variable to add my preferred Javascript server. From an end user perspective, this was harder to do than making the same change with lsp-mode. For reference, here is what I ended up doing to get it working (defclass eglot-deno (eglot-lsp-server) () :documentation "A custom class for deno lsp.") (cl-defmethod eglot-initialization-options ((server eglot-deno)) "Passes through required deno initialization options" (list :enable t :lint t)) (add-to-list 'eglot-server-programs '((js-mode typescript-mode) . (eglot-deno "deno" "lsp")))