Subject: bug#70211: emacs-eglot fails after upgrade to emacs-29.3

From: hiecaq <[email-masked]>
Date: Sat, 13 Apr 2024 18:58:57 +0800

Lilly via Bug reports for GNU Guix <[email-masked]> writes:

> Upgrading jsonrpc to version 1.0.25 solved the issue for me.

Hi, the above solution does not work for me so I tried to dig into 
the problem further, and I think I've moved closer to the real 
cause of this problem.

TLDR:

This issue is more close related to jsonrpc instead of eglot, and 
putting
> (setq load-no-native t)
In early-init.el fixes the problem for me.

The first thing I noticed is that if we look up 
"jsonrpc-connection", Help page tells us that it is a 
native-compiled function, which is the hint to my following 
attempts because in my configurations  packages are only 
byte-complied and not native-compiled, while built-ins are 
native-compiled. This can be quickly checked if you open the 
jsonrpc.elc file. (and I believe that it is the same case for the 
upstream Guix)

Also, if you visit the "jsonrpc-connection"'s class Help page, it 
shows that it does not have a slot named 
"events-buffer-config". Instead it has 
"events-buffer-scrollback-size", which reflects the corresponding 
file in 29.3 built-in.

So my guess is that Emacs somehow prefers the native-compiled 
version (from the built-in) over the byte-compiled version (from 
the package), even if the latter is newer. I do have "(setq 
load-prefer-newer t)" in my early-init.el, but it still works that 
way. I'm not sure why the package loading works as expected before 
recent updates in Guix though.