Subject: bug#62720: 29.0.60; Not easy at all to upgrade :core packages like Eglot

From: João Távora <[email-masked]>
Date: Fri, 14 Apr 2023 18:32:42 +0100

On Fri, Apr 14, 2023 at 5:53 PM Philip Kaludercic <[email-masked]> wrote:

> As this issue only affects Eglot

[Didn't other packages also make it into :core?]

> (a package that doesn't require that
> much customisation to be used), I don't think the situation is as
> drastic as you are portraying it to be.

> If we all try to have a cooperative, non-alarmist attitude towards
> solving the issue at hand, I am sure a suitable solution will be found.

It's true it doesn't have many customization now, so downright
erroring is probably rare.  But it's been advancing fast and
that may not always be the case. As I said Eglot 1.12 in Emacs
29 has lots of missing functionality and even bugs that are too
risky to fix in that version.

So I'm not being alarmist, I think.  With 5 years maintainership
of this package and well over 1000 issues, I think I make a fair
assessment of user's expectations.  As to being cooperative, I've
proposed 3 different patches already, answered every question about
them and proposed n other solutions.

But I like your optimism nonetheless :-)

> Also keep in mind that I have proposed multiple patches that take
> difference approaches.  Perhaps it would be of use to recapitulate them,
> and you can explain which would be satisfying and which you think
> wouldn't be as helpful:
>
> - Use `package-install' to switch from a built-in package to the version
>   from ELPA
>
>   - Alternatively it has to be confirmed using a prefix argument
>   - Alternatively it has to be enabled using a user option
>
> - Use `package-update' (not `package-update-all') to switch from a
>   built-in package to the version from ELPA
>
>   (Same alternatives as above)
>
> - Have both `package-update' and `package-update-all' switch potentially
>   all packages from built-in versions to ELPA versions
>
>   (Same alternatives as above)
>
> - Provide a separate command to switch from a built-in version to a
>   version from ELPA
>
> That should be it?

If it's not clear yet, I want(ed) something that users can use
_regardless_ of the version of Emacs to bring Eglot to the
latest version.  I want users to be able to do this easily
for obvious reasons.  The prime candidate for that "something"
is M-x package-install both in its command and non-interactive
form.  But if that isn't possible, the next best thing is
a 4 line eglot-update command in eglot.el which would eventually
boil down to the  same (because Emacs 26/27/28 users would eventually
also get it).  That idea was explicitly rejected, but I hope it
illustrates what I would prefer.

A command and function with enduring semantics, basically, the
kind you expect from a system like Emacs.

Any one of your or other's solutions that provide such a
command/function are most welcome.  Any other that doesn',
I'm indifferent to it.  Which doesn't mean "against" or "hostile".

And of course I thank you very much for your efforts in searching
for a solution.

Here's another solution you may want to consider.  package-install
in Emacs 29 updates built-ins non-interactively always.  Interactively
asks the user with a confirmation prompt.  This solution would
also work.

Here's yet another one. package-install like the above but, as has
been proposed, carefully vets the builtins that are subject to
from a controlled whitelist, which would include Eglot.  Stefan, Dmitry
and myself have proposed some variation of this.

Anyway, if my preference doesn't materialize, I'm going to recommend
in the manual:

M-: (package-install (alist-get 'eglot package-archive-contents) RET

which works interactively and non-interactively in every version
of Emacs.  It's not pretty but it's the best I have.  It's better
than to write "if you have emacs 29, do this, else do that".

João