GNU bug report logs -
#58745
29.0.50; eglot managed-major-mode must be a list
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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ão
On Thu, Oct 27, 2022 at 5:19 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: Stephen Leake <stephen_leake <at> stephe-leake.org>
> > 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ão, any comments?
>
--
João Távora
[Message part 2 (text/html, inline)]
This bug report was last modified 2 years and 264 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.