[PATCH} gnu: emacs-eglot-x: Update to latest commit

  • Open
  • quality assurance status badge
Details
2 participants
  • Liliana Marie Prikler
  • Javier Olaechea
Owner
unassigned
Submitted by
Javier Olaechea
Severity
normal
J
J
Javier Olaechea wrote on 16 Jan 04:29 +0100
CAFVS=zBwV+mcwzHOamj9qJ=0Zy+1HBi0zEBa9Pu7N=_oqj4TwQ@mail.gmail.com
Hi, attached is a patch to update eglot-x to its latest commit, unreleased
to fix. It does fix an error that ocurrs when using eglot-x with an eglot
version 1.16 or higher and rust-analyzer. Should I also use the git-version
helper?

Cheers,
Javier Olaechea

--
"I object to doing things that computers can do." — Olin Shivers
Attachment: file
From 893ff0f1e7de3f63b9b562d051f9fe12da179288 Mon Sep 17 00:00:00 2001
Message-ID: <893ff0f1e7de3f63b9b562d051f9fe12da179288.1736997510.git.pirata@gmail.com>
From: Javier Olaechea <pirata@gmail.com>
Date: Wed, 15 Jan 2025 19:48:42 -0500
Subject: [PATCH] gnu: emacs-eglot-x: Update to latest commit

* gnu/packages/emacs-xyz.scm (emacs-eglot-x): Update to latest commit

The current emacs-eglot-x version we package is broken when used with an eglot
version higher than 1.16. We currently ship eglot 1.17. Upstream has fixed
this in the commit 354150, but still hasn't released a new version.

Change-Id: Id39f4805dc37902048139049785a4f7852202a8c
---
gnu/packages/emacs-xyz.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 9b3139dfa1..f073522533 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -21468,7 +21468,7 @@ (define-public emacs-eglot
(define-public emacs-eglot-x
;; Not tagged.
- (let ((commit "a09ab28cf01d7cbb223ad83fbbb694c5158c96b8"))
+ (let ((commit "295c0309dc836966467c95867d1593f1376507b6"))
(package
(name "emacs-eglot-x")
(version "0.6")
@@ -21480,7 +21480,7 @@ (define-public emacs-eglot-x
(file-name (git-file-name name version))
(sha256
(base32
- "0s17nv59gzgqgskid41lfacsqnzdiq2p3ds0vglcfqwypr3k898c"))))
+ "1w9nbnfdcdikhn603dkcmqzkfg80vhd71fd50mlsr8sm0h8ygy0v"))))
(build-system emacs-build-system)
(inputs (list emacs-eglot))
(home-page "https://github.com/nemethf/eglot-x")

base-commit: 35d13aab7ebca187343c54b800711bfea02859b9
--
2.47.1
L
L
Liliana Marie Prikler wrote on 16 Jan 08:46 +0100
2df8dec193dcf2a7f71be9f4e48118d067975446.camel@gmail.com
Am Donnerstag, dem 16.01.2025 um 03:29 +0000 schrieb Javier Olaechea:
Toggle quote (4 lines)
> Hi, attached is a patch to update eglot-x to its latest commit,
> unreleased to fix. It does fix an error that ocurrs when using eglot-
> x with an eglot version 1.16 or higher and rust-analyzer. Should I
> also use the git-version helper?
Yes, please use git-version.

And for anyone else using random commits while coding version without
it, let this be a reminder to use git-version.

Btw. you reference commit 354150c in your patch but then build from a
different commit. Perhaps you could use that single commit as a patch
instead?

Cheers
J
J
Javier Olaechea wrote on 17 Jan 03:09 +0100
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
CAFVS=zAo7-ZBJoqMKJJREs4pWY3LXrQQudC=YumVnG6oQNJ=Tg@mail.gmail.com
Thanks for the quick response!

Btw. you reference commit 354150c in your patch but then build from a
Toggle quote (4 lines)
> different commit. Perhaps you could use that single commit as a patch
> instead?
>

I like that better, I've updated the patch to instead apply the patch for
that commit instead along with a note to drop the patch when the next
version of eglot-x is released.


On Thu, Jan 16, 2025 at 7:46?AM Liliana Marie Prikler <
liliana.prikler@gmail.com> wrote:

Toggle quote (6 lines)
> Yes, please use git-version.
>
> And for anyone else using random commits while coding version without
> it, let this be a reminder to use git-version.
>

Given that now we are using the commit for version 0.6 (which doesn't have
a tag) there is no need to to use git-version. t was only in the case that
we started shipping an unreleased commit as the version, correct?

--
"I object to doing things that computers can do." — Olin Shivers
Attachment: file
From 0b7653371c0803e03fe04355f3d4e7a247811d51 Mon Sep 17 00:00:00 2001
Message-ID: <0b7653371c0803e03fe04355f3d4e7a247811d51.1737079150.git.pirata@gmail.com>
From: Javier Olaechea <pirata@gmail.com>
Date: Wed, 15 Jan 2025 19:48:42 -0500
Subject: [PATCH v2] gnu: emacs-eglot-x: Backport an unreleased fix

* gnu/packages/emacs-xyz.scm (emacs-eglot-x): Backport an unreleased fix

The current emacs-eglot-x version we package is broken when used with an eglot
version higher than 1.16. We currently ship eglot 1.17. Upstream has fixed
this in the commit 354150, but still hasn't released a new version. We can
apply the fix as stand-alone patch while we wait for them to release a version.

Change-Id: Id39f4805dc37902048139049785a4f7852202a8c
---
gnu/packages/emacs-xyz.scm | 6 ++++-
.../emacs-eglot-x-fix-apply-text-edits.patch | 23 +++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/emacs-eglot-x-fix-apply-text-edits.patch

Toggle diff (50 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 9b3139dfa1..1347e73124 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -21480,7 +21480,11 @@ (define-public emacs-eglot-x
(file-name (git-file-name name version))
(sha256
(base32
- "0s17nv59gzgqgskid41lfacsqnzdiq2p3ds0vglcfqwypr3k898c"))))
+ "0s17nv59gzgqgskid41lfacsqnzdiq2p3ds0vglcfqwypr3k898c"))
+ ;; Backporting an unreleased fix from
+ ;; https://github.com/nemethf/eglot-x/commit/354150c299e241df09c8b904b68177fd9b41fe0e
+ ;; Remove this patch once version 0.7 is released
+ (patches (search-patches "emacs-eglot-x-fix-apply-text-edits.patch"))))
(build-system emacs-build-system)
(inputs (list emacs-eglot))
(home-page "https://github.com/nemethf/eglot-x")
diff --git a/gnu/packages/patches/emacs-eglot-x-fix-apply-text-edits.patch b/gnu/packages/patches/emacs-eglot-x-fix-apply-text-edits.patch
new file mode 100644
index 0000000000..b9dcebded3
--- /dev/null
+++ b/gnu/packages/patches/emacs-eglot-x-fix-apply-text-edits.patch
@@ -0,0 +1,23 @@
+diff --git a/eglot-x.el b/eglot-x.el
+index a694f90..221822d 100644
+--- a/eglot-x.el
++++ b/eglot-x.el
+@@ -659,10 +659,17 @@ (defun eglot-x--check-capability (&rest capabilities)
+
+ ;;; Snippet TextEdit
+
+-(defun eglot-x--apply-text-edits (edits &optional version)
++(defun eglot-x--apply-text-edits (edits &optional version silent)
+ "Apply EDITS for current buffer if at VERSION, or if it's nil.
+ This is almost a verbatim copy of `eglot--apply-text-edits', but
+ it handles the SnippetTextEdit format."
++ ;; NOTE: eglot--apply-text-edits changed a lot since this defun was
++ ;; imlemented. Additionally, rust-analyzer has changed as well.
++ ;; Now it only sends one SnippetTextEdit. Hence the implementation
++ ;; should be updated, but "if it ain't broke, don't fix it". And
++ ;; this whole extension is going to be obsoleted soon:
++ ;; https://github.com/microsoft/language-server-protocol/issues/724#issuecomment-1850413029
++
+ ;; This is quite rust-analyzer specific. It assumes there is at
+ ;; most one meaningful SnippetTextEdit and that can be identified by
+ ;; searching for "$0".

base-commit: 35d13aab7ebca187343c54b800711bfea02859b9
--
2.47.1
L
L
Liliana Marie Prikler wrote on 17 Jan 10:12 +0100
(name . Javier Olaechea)(address . pirata@gmail.com)
45791c04b34f4d43215bda48f3a185d8a986d14f.camel@gmail.com
Am Freitag, dem 17.01.2025 um 02:09 +0000 schrieb Javier Olaechea:
Toggle quote (11 lines)
> On Thu, Jan 16, 2025 at 7:46?AM Liliana Marie Prikler
> <liliana.prikler@gmail.com> wrote:
> > Yes, please use git-version.
> >
> > And for anyone else using random commits while coding version
> > without it, let this be a reminder to use git-version.
>
> Given that now we are using the commit for version 0.6 (which doesn't
> have a tag) there is no need to to use git-version. t was only in the
> case that we started shipping an unreleased commit as the version,
> correct?
Yeah, for keeping changes small and self-contained it's fine to do
that. I'd just like to make it known that this style makes it very
unclear what's happening, so that a future bumper is hopefully aware of
that :)

Cheers
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75597@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75597
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch