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

From: Romain Ouabdelkader <[email-masked]>
Date: Fri, 14 Mar 2025 11:05:06 +0100

Hello,

> 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.

Sorry this wasn't clear, I use straight to install packages which uses a
git repository to mirror eglot changes from ELPA devel:
https://github.com/emacs-straight/eglot.
Since this may not be familiar to you, I just took the
commit with the same eglot changes in the emacs repository.

The version of eglot I'm using is 1.18.0.20250302.222215 (from ELPA
devel: https://elpa.gnu.org/devel/eglot.html)

I haven't been able to reproduce the error so far.
As expected it will be difficult to fix the error without a repro. I
shared the stack trace in case it might be familiar to you. I guess we can
close the issue.

Thank you!

On Thu, Mar 13, 2025 at 9:12 PM João Távora <[email-masked]> wrote:

> 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
>