From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#58745: 29.0.50; eglot managed-major-mode must be a list Date: Thu, 27 Oct 2022 18:27:14 +0100 Message-ID: References: <86pmeijuvz.fsf@stephe-leake.org> <83mt9hkznm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003b501005ec077080" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13379"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58745@debbugs.gnu.org, Stephen Leake To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 27 19:28:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oo6fs-0003Do-G1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Oct 2022 19:28:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo6ep-0005zp-UT; Thu, 27 Oct 2022 13:27:07 -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 1oo6el-0005nS-BW for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 13:27:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo6ek-00009k-Sh for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 13:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oo6ek-0003Pu-Bs for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 13:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Oct 2022 17:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58745 X-GNU-PR-Package: emacs Original-Received: via spool by 58745-submit@debbugs.gnu.org id=B58745.166689158313087 (code B ref 58745); Thu, 27 Oct 2022 17:27:02 +0000 Original-Received: (at 58745) by debbugs.gnu.org; 27 Oct 2022 17:26:23 +0000 Original-Received: from localhost ([127.0.0.1]:59203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6e6-0003P0-Ov for submit@debbugs.gnu.org; Thu, 27 Oct 2022 13:26:23 -0400 Original-Received: from mail-oi1-f174.google.com ([209.85.167.174]:37486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6e5-0003Om-0e for 58745@debbugs.gnu.org; Thu, 27 Oct 2022 13:26:21 -0400 Original-Received: by mail-oi1-f174.google.com with SMTP id i7so3032097oif.4 for <58745@debbugs.gnu.org>; Thu, 27 Oct 2022 10:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Qyd3ZUvpBjcVtVRTRNk4YN5JQTZAxZrtY8BXQEdWp+Y=; b=qvP1c8fsxuIwUR3/hqg4S/UCjmg9qhZVbvM6PbX5UF5khzAVb/GrvgPgbS272FfvzS YTEan6UQlZmbLyFOSIAQ06/cbGBAyJ0EPYQjiLOTCB0DoBd2dQDtdOYXYBTTOe2+lwtI hmynuWcCHr7Vrz8+oq+aO6VqaI56GvZxh46OqAkuBX5GnqSstiuQqsTJpx2hc8pp0o5g VKEl2/d19cd1eBv9u9ZXTvil6MCL3b47iPsGxQWLDnqHLN0et/SXVvRGlFlyHuEelhU2 45OXOar6mbV//HZVBHa2nzI7RtQMJTYZkBugdMJOzYtxy9gBuHXfxR82LkV+qenEPqZA J0NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Qyd3ZUvpBjcVtVRTRNk4YN5JQTZAxZrtY8BXQEdWp+Y=; b=2v3ET244OLMcV+I8+LGZDzq+bbQZdJljF/Yylc2/qBEjFq3vydRg6xqofttk7pqnt+ OFxQvXP2GPhbuehyAICIDZd958wAhmAyUZSqza03VAvTTYUAIFzqWU2wHfgPpTlK8p97 LB3Wpr4S4YuIaJX/RvDHqfSKcMQE8rNnRjfGVPMmRTt08gele1jlXxEHOuE41t2yc7cF ZqOh5cVkQUgLdcPf32tBiBIUKuZBb/Gt+M0jo3dUJtSWF9gIj1J71JGKO2/QuTqdPKEH mtW//VITtbjSekq7vW3xFv11mCVU8YiiyD3IBHtJoNq9eUJqnytBO68aNZOjKYdIlV+T jh4A== X-Gm-Message-State: ACrzQf3nx7Z4TUXViGItWBYpaVFObqBZy40TaRMcpH+EnBUAd2580XlT A+afOgOlgRxIlnXjdlb1UlPBC51smN3ziXyps+U= X-Google-Smtp-Source: AMsMyM6nrS04DqB5wEJCu1SIP3SZqkpUyZb0xqS3xAqIpWRzTu3ZkM9Zi3WWvplY/YpTKlZyFyGEdKY1f/vdVXvxjvU= X-Received: by 2002:a05:6808:1a1f:b0:354:b33b:8b0d with SMTP id bk31-20020a0568081a1f00b00354b33b8b0dmr5243138oib.171.1666891575413; Thu, 27 Oct 2022 10:26:15 -0700 (PDT) In-Reply-To: <83mt9hkznm.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246341 Archived-At: --0000000000003b501005ec077080 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes, this has been discussed on emacs-devel and an equivalent patch pushed. So the bug can be closed. The function eglot doesn't have any non-interactive use that I can envision= . Its INTERACTIVE argument is a historical remnant from a time where the function was called eglot-start-process. Nevertheless, it makes sense that it converts the argument into a list. Stephen, I would advise against using eglot from Lisp, in principle but I haven't seen your use case Jo=C3=A3o On Thu, Oct 27, 2022 at 5:19 PM Eli Zaretskii wrote: > > From: Stephen Leake > > Date: Sun, 23 Oct 2022 10:46:08 -0700 > > > > I'm calling `eglot' from lisp. The doc string says the first argument > > `managed-major-mode' is an atom, not a list. But it is passed to > > eglot--connect as the first argument, which is expected to be a list of > > major modes. When called interactively, `managed-major-mode' is set by > > (eglot--guess-contact t), which returns a list. > > > > So when not interactive, `eglot' must convert `managed-major-mode' into > > a list: > > > > ------------------- > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > > index 71001ba680..dee88db022 100644 > > --- a/lisp/progmodes/eglot.el > > +++ b/lisp/progmodes/eglot.el > > @@ -1078,6 +1078,8 @@ eglot > > > > INTERACTIVE is t if called interactively." > > (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, any comments? > --=20 Jo=C3=A3o T=C3=A1vora --0000000000003b501005ec077080 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes, this has been discussed on emacs-devel and an eq= uivalent patch
pushed.

So the bug can be= closed.

The function eglot doesn't have a= ny non-interactive use that I can envision.
Its INTERACTIVE argum= ent is a historical remnant from a time where
the function w= as called eglot-start-process.=C2=A0 Nevertheless, it makes sense
that it converts the argument into a list.

Stephe= n, I would advise against using eglot from Lisp, in principle
but I haven't seen your use case

Jo=C3=A3o


On Thu, Oct 27, 2022 at 5:19 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Stephen Leake <stephen_lea= ke@stephe-leake.org>
> Date: Sun, 23 Oct 2022 10:46:08 -0700
>
> I'm calling `eglot' from lisp. The doc string says the first a= rgument
> `managed-major-mode' is an atom, not a list. But it is passed to > eglot--connect as the first argument, which is expected to be a list o= f
> major modes. When called interactively, `managed-major-mode' is se= t by
> (eglot--guess-contact t), which returns a list.
>
> So when not interactive, `eglot' must convert `managed-major-mode&= #39; into
> a list:
>
> -------------------
> diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
> index 71001ba680..dee88db022 100644
> --- a/lisp/progmodes/eglot.el
> +++ b/lisp/progmodes/eglot.el
> @@ -1078,6 +1078,8 @@ eglot
>=C2=A0
>=C2=A0 INTERACTIVE is t if called interactively."
>=C2=A0 =C2=A0 (interactive (append (eglot--guess-contact t) '(t)))<= br> > +=C2=A0 (unless (listp managed-major-mode)
> +=C2=A0 =C2=A0 (setq managed-major-mode (list managed-major-mode))) >=C2=A0 =C2=A0 (let* ((current-server (eglot-current-server))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(live-p (and current-server (j= sonrpc-running-p current-server))))
>=C2=A0 =C2=A0 =C2=A0 (if (and live-p
> ------------------

Jo=C3=A3o, any comments?


--
Jo=C3=A3o T=C3=A1vora
--0000000000003b501005ec077080--