Subject: bug#76940: 30.1; Invalid eglot--recent-changes state

From: João Távora <[email-masked]>
Date: Thu, 13 Mar 2025 20:13:01 +0000

On Thu, Mar 13, 2025 at 9:59 AM Eli Zaretskii <[email-masked]> wrote:
>
> > From: Romain Ouabdelkader <[email-masked]>
> > Date: Tue, 11 Mar 2025 12:47:40 +0100
> >
> > I got the following error with eglot while editing, it seems that
> > eglot--recent-changes is in an invalid state, I'm not sure how to
> > reproduce the issue.
>
> João, could you please take a look?

This is almost impossible to analyse without a repro.

Anyway, I looked a bit into this and the only explanation I have for the
:rangeLength to be that odd cons instead of the usual fixnum is for
PRE-CHANGE-LENGTH as specified in the docstring of after-change-functions
to have been that cons in the first place.  So maybe someone has time
to look inside the C code of after-change-functions and figure out if that's
even possible.

That said, Emacs is Emacs and a million things can interfere in Lisp land.
Meow,vertico,marginalia,doom, corfu,treemans, there are a million
packages I have absolutely no idea how they work.

I don't even understand if this is Eglot from Emacs master or a package
installation.  The report mentions a commit SHA which is not unheard of
but odd for released versions of Emacs.

João

PS: There is also this "straight" build of Eglot, which is not the
normal supported
way using package.el.

> > /Users/romain.ouabdelkader/.emacs.d/straight/build/eglot/eglot hides
> > /opt/homebrew/Cellar/emacs-plus@30/30.1/share/emacs/30.1/lisp/progmodes/eglot