unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Stephen Leake <stephen_leake@stephe-leake.org>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Minor bug in eglot; managed-major-mode must be a list
Date: Tue, 25 Oct 2022 09:35:36 +0100	[thread overview]
Message-ID: <CALDnm53Q_OX6brNFLMZqWANnnGrDn3det2vHW2WZPx+nfH1gUQ@mail.gmail.com> (raw)
In-Reply-To: <86lep6juga.fsf@stephe-leake.org>

[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]

On Mon, Oct 24, 2022, 05:38 Stephen Leake <stephen_leake@stephe-leake.org>
wrote:

> See bug#58745; there's a patch included. Report duplicated here:
>
> 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:
>
> -------------------
>
> [2. text/x-patch]
> 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ão Távora; ok to commit this patch?
>

Yes (but please CC me next time to grab my attention).

Also see other's comments about ensure-list.

Also eglot, the function, does not have any non-interactive use i know of.

João

>

[-- Attachment #2: Type: text/html, Size: 2226 bytes --]

      parent reply	other threads:[~2022-10-25  8:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-23 17:55 Minor bug in eglot; managed-major-mode must be a list Stephen Leake
2022-10-24  4:49 ` Theodor Thornhill
2022-10-24  8:54   ` Robert Pluim
2022-10-24 15:54     ` Philip Kaludercic
2022-10-24 16:16       ` Robert Pluim
2022-10-25  8:33         ` João Távora
2022-10-25 10:16           ` eglot.el commentary suggestion Robert Pluim
2022-10-25 11:00             ` João Távora
2022-10-25 11:16               ` Po Lu
2022-10-25 12:26                 ` Robert Pluim
2022-10-25 12:51                   ` João Távora
2022-10-25 13:18                     ` Robert Pluim
2022-10-25  8:35 ` João Távora [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALDnm53Q_OX6brNFLMZqWANnnGrDn3det2vHW2WZPx+nfH1gUQ@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=stephen_leake@stephe-leake.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).