lilyp pushed a commit to branch emacs-team
in repository guix.

commit 9f74142b21aae65cf8cb6759305aab777d217dc0
Author: Liliana Marie Prikler <liliana.prik...@gmail.com>
AuthorDate: Sun Mar 2 13:20:28 2025 +0100

    gnu: emacs-helpful: Fix build.
    
    * gnu/packages/patches/emacs-helpful-fix-tests.patch: Squash a test fix for
    Emacs 30.
    * gnu/packages/patches/emacs-helpful-fix-signature.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it here.
    * gnu/packages/emacs-xyz.scm (emacs-helpful)[patches]: Use it here.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/emacs-xyz.scm                         |  4 ++-
 .../patches/emacs-helpful-fix-signature.patch      | 34 ++++++++++++++++++++++
 gnu/packages/patches/emacs-helpful-fix-tests.patch | 20 +++++++------
 4 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index eb473653cb..6f3c3300d9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1222,6 +1222,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/emacs-eglot-x-fix-apply-text-edits.patch                
        \
   %D%/packages/patches/emacs-exec-path.patch                   \
   %D%/packages/patches/emacs-fix-scheme-indent-function.patch  \
+  %D%/packages/patches/emacs-helpful-fix-signature.patch       \
   %D%/packages/patches/emacs-helpful-fix-tests.patch   \
   %D%/packages/patches/emacs-highlight-stages-add-gexp.patch   \
   %D%/packages/patches/emacs-json-reformat-fix-tests.patch     \
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index d00a0ba49d..d23666de92 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -27587,7 +27587,9 @@ downloading manager for Emacs.")
        (file-name (git-file-name name version))
        (sha256
         (base32 "03afgdbs5nmhw833svrqky7fmfs1zlvqzcj7j5g29sakivs60xqc"))
-       (patches (search-patches "emacs-helpful-fix-tests.patch"))))
+       (patches (search-patches
+                 "emacs-helpful-fix-signature.patch"
+                 "emacs-helpful-fix-tests.patch"))))
     (build-system emacs-build-system)
     (propagated-inputs
      (list emacs-dash emacs-elisp-refs emacs-f emacs-s))
diff --git a/gnu/packages/patches/emacs-helpful-fix-signature.patch 
b/gnu/packages/patches/emacs-helpful-fix-signature.patch
new file mode 100644
index 0000000000..867df443cb
--- /dev/null
+++ b/gnu/packages/patches/emacs-helpful-fix-signature.patch
@@ -0,0 +1,34 @@
+From 3794389ef685b6a59b3a487d0492c3add3c42c2f Mon Sep 17 00:00:00 2001
+From: Xiyue Deng <manp...@gmail.com>
+Date: Wed, 26 Feb 2025 15:39:42 -0800
+Subject: [PATCH] Check for interpreted-function-p
+
+Emacs 30.x added interpreted-function which is different from
+byte-code-function, and hence helpful--signature will try to treat it
+like a lambda which will fail with
+
+,----
+| (wrong-type-argument listp #[(x) (x) (t) nil "Foo"])
+`----
+
+This patch adds tests for such case using interpreted-function-p when
+it's available.
+---
+ helpful.el | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/helpful.el b/helpful.el
+index b100816..331ece8 100644
+--- a/helpful.el
++++ b/helpful.el
+@@ -2570,7 +2570,9 @@ For example, \"(some-func FOO &optional BAR)\"."
+             (cond
+              ((symbolp sym)
+               (help-function-arglist sym))
+-             ((byte-code-function-p sym)
++             ((or (byte-code-function-p sym)
++                  (if (fboundp 'interpreted-function-p)
++                      (interpreted-function-p sym)))
+               ;; argdesc can be a list of arguments or an integer
+               ;; encoding the min/max number of arguments. See
+               ;; Byte-Code Function Objects in the elisp manual.
\ No newline at end of file
diff --git a/gnu/packages/patches/emacs-helpful-fix-tests.patch 
b/gnu/packages/patches/emacs-helpful-fix-tests.patch
index 61ed0671a4..f788a7dee6 100644
--- a/gnu/packages/patches/emacs-helpful-fix-tests.patch
+++ b/gnu/packages/patches/emacs-helpful-fix-tests.patch
@@ -1,16 +1,18 @@
-From 233e254bbe44f70ca899a506b3706af489228fda Mon Sep 17 00:00:00 2001
-From: aagon <aymeric.a...@hotmail.fr>
-Date: Thu, 10 Aug 2023 20:03:52 +0200
-Subject: [PATCH] Repair helpful--display-implementations test for emacs 29.1
-
----
- test/helpful-unit-test.el | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
 diff --git a/test/helpful-unit-test.el b/test/helpful-unit-test.el
 index 0f5177b..0716b0d 100644
 --- a/test/helpful-unit-test.el
 +++ b/test/helpful-unit-test.el
+@@ -734,7 +734,9 @@ associated a lambda with a keybinding."
+   (should
+    (equal
+     (length (helpful--keymaps-containing #'helpful--dummy-command))
+-    2))
++    (if (< emacs-major-version 30)
++        2
++      3)))
+ 
+   ;; Undo keybinding.
+   (global-set-key (kbd "C-c M-S-c") nil)
 @@ -1089,8 +1089,12 @@ find the source code."
    (require 'xref)
    (helpful-function 'xref-location-marker)

Reply via email to