[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minor bug in eglot; managed-major-mode must be a list
From: |
Theodor Thornhill |
Subject: |
Re: Minor bug in eglot; managed-major-mode must be a list |
Date: |
Mon, 24 Oct 2022 06:49:56 +0200 |
On 23 October 2022 19:55:33 CEST, 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?
>
I believe eglot has a helper for this - 'eglot--ensure-list', maybe use that
for consistency?
Theodor
- Minor bug in eglot; managed-major-mode must be a list, Stephen Leake, 2022/10/23
- Re: Minor bug in eglot; managed-major-mode must be a list,
Theodor Thornhill <=
- Re: Minor bug in eglot; managed-major-mode must be a list, Robert Pluim, 2022/10/24
- Re: Minor bug in eglot; managed-major-mode must be a list, Philip Kaludercic, 2022/10/24
- Re: Minor bug in eglot; managed-major-mode must be a list, Robert Pluim, 2022/10/24
- Re: Minor bug in eglot; managed-major-mode must be a list, João Távora, 2022/10/25
- eglot.el commentary suggestion, Robert Pluim, 2022/10/25
- Re: eglot.el commentary suggestion, João Távora, 2022/10/25
- Re: eglot.el commentary suggestion, Po Lu, 2022/10/25
- Re: eglot.el commentary suggestion, Robert Pluim, 2022/10/25
- Re: eglot.el commentary suggestion, João Távora, 2022/10/25
- Re: eglot.el commentary suggestion, Robert Pluim, 2022/10/25