From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Minor bug in eglot; managed-major-mode must be a list Date: Mon, 24 Oct 2022 06:49:56 +0200 Message-ID: <74041D6B-1149-4C51-B1AF-76397C1DF7F8@thornhill.no> References: <86lep6juga.fsf@stephe-leake.org> 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="37166"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org, Stephen Leake , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 24 08:31:54 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 1omr05-0009B1-Dp for ged-emacs-devel@m.gmane-mx.org; Mon, 24 Oct 2022 08:31:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ompQ1-0003Yo-B1; Mon, 24 Oct 2022 00:50:33 -0400 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 1ompPi-0003Ry-Ip for emacs-devel@gnu.org; Mon, 24 Oct 2022 00:50:16 -0400 Original-Received: from out0.migadu.com ([94.23.1.103]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ompPg-00041p-3Q for emacs-devel@gnu.org; Mon, 24 Oct 2022 00:50:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1666587009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sn/mw7pwlDBdgxysxrf+R30d4j1F1ByaVww/NZgEtv8=; b=ymwOIpVBXz6isy5SL0HkPzDwQlWE4/k/Ac32bdtSDyMS4sl933A9Dld/RTYnXnGhMKxkus HZgijy7cjzZJhnJ7ZHjmxiWv0v8HRTYHLT4f+ixf3b/l7My3S/w3+8WNhDUxq+DXLUcRtV OYqPt62fEJ1KBtWDe0NIx+GdT35KsMhsSg1kqR/AK2ThfPEZ4O9w1Y+VWJrfOLy7ix4hAd jYsvn7XLhH8lxBxUKup4Tp5Lm8/or8uqxoNdkn3REmnEEsiuvJJsSphQm2arayjKApIrvV TAJyTWAXoOOsNTleg22/GznZukWka7tkKwaLTJ+B0Xm2P8resV2sa+Hfw7bYvg== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <86lep6juga.fsf@stephe-leake.org> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=94.23.1.103; envelope-from=theo@thornhill.no; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298339 Archived-At: On 23 October 2022 19:55:33 CEST, Stephen Leake wrote: >See bug#58745; there's a patch included=2E Report duplicated here: > >I'm calling `eglot' from lisp=2E The doc string says the first argument >`managed-major-mode' is an atom, not a list=2E But it is passed to >eglot--connect as the first argument, which is expected to be a list of >major modes=2E When called interactively, `managed-major-mode' is set by >(eglot--guess-contact t), which returns a list=2E > >So when not interactive, `eglot' must convert `managed-major-mode' into >a list: > >------------------- > >[2=2E text/x-patch] >diff --git a/lisp/progmodes/eglot=2Eel b/lisp/progmodes/eglot=2Eel >index 71001ba680=2E=2Edee88db022 100644 >--- a/lisp/progmodes/eglot=2Eel >+++ b/lisp/progmodes/eglot=2Eel >@@ -1078,6 +1078,8 @@ eglot >=20 > INTERACTIVE is t if called interactively=2E" > (interactive (append (eglot--guess-contact t) '(t))) >+ (unless (listp managed-major-mode) >+ (setq managed-major-mode (list managed-major-mode))) > (let* ((current-server (eglot-current-server)) > (live-p (and current-server (jsonrpc-running-p current-server))= )) > (if (and live-p >------------------ > > >Jo=C3=A3o T=C3=A1vora; ok to commit this patch? > I believe eglot has a helper for this - 'eglot--ensure-list', maybe use th= at for consistency? Theodor