guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: emacs-deferred: Fix wrong number of argument


From: guix-commits
Subject: branch master updated: gnu: emacs-deferred: Fix wrong number of arguments.
Date: Thu, 26 May 2022 19:53:27 -0400

This is an automated email from the git hooks/post-receive script.

lilyp pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new d37c7f7ad4 gnu: emacs-deferred: Fix wrong number of arguments.
d37c7f7ad4 is described below

commit d37c7f7ad4134cc15d1558eb6c0bc4c59a0db1af
Author: Liliana Marie Prikler <liliana.prikler@gmail.com>
AuthorDate: Fri May 27 00:12:37 2022 +0200

    gnu: emacs-deferred: Fix wrong number of arguments.
    
    * gnu/packages/patches/emacs-deferred-fix-number-of-arguments.patch: New 
file.
    * gnu/packages/emacs-xyz.scm (emacs-deferred)[patches]: Use it here.
    * gnu/local.mk (dist_patch_DATA): Add it here.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/emacs-xyz.scm                         |  4 +-
 .../emacs-deferred-fix-number-of-arguments.patch   | 58 ++++++++++++++++++++++
 3 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index a4250248ca..bc82c5ba9f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1023,6 +1023,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/elm-offline-package-registry.patch      \
   %D%/packages/patches/elm-reactor-static-files.patch          \
   %D%/packages/patches/elogind-revert-polkit-detection.patch   \
+  %D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch    \
   %D%/packages/patches/emacs-exec-path.patch                   \
   %D%/packages/patches/emacs-ess-fix-obsolete-function-alias.patch     \
   %D%/packages/patches/emacs-git-email-missing-parens.patch    \
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 977debae51..f7fb6aac35 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -6552,7 +6552,9 @@ framework for Emacs Lisp to be used with @code{ert}.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0xy9zb6wwkgwhcxdnslqk52bq3z24chgk6prqi4ks0qcf2bwyh5h"))))
+        (base32 "0xy9zb6wwkgwhcxdnslqk52bq3z24chgk6prqi4ks0qcf2bwyh5h"))
+       (patches
+        (search-patches "emacs-deferred-fix-number-of-arguments.patch"))))
     (build-system emacs-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/emacs-deferred-fix-number-of-arguments.patch 
b/gnu/packages/patches/emacs-deferred-fix-number-of-arguments.patch
new file mode 100644
index 0000000000..fdb444c29b
--- /dev/null
+++ b/gnu/packages/patches/emacs-deferred-fix-number-of-arguments.patch
@@ -0,0 +1,58 @@
+From 226734f06196d31971d8ca2026a9ce432d5227d0 Mon Sep 17 00:00:00 2001
+From: r0man <roman@burningswell.com>
+Date: Thu, 26 May 2022 10:42:25 +0200
+Subject: [PATCH] Fix wrong-number-of-arguments error
+
+With Emacs 28 I'm seeing the following error when running the tests.
+
+```
+deferred error : (wrong-number-of-arguments #<subr 
start-process-shell-command> 4)
+```
+
+I believe this is because the `start-process-shell-command` function
+is called with the command arguments as &rest parameters. This is the
+function signature of `start-process-shell-command`, and it only takes
+3 arguments, the name, buffer, and command. The command argument can
+be a shell string like "ls -l" for example.
+
+```
+(defun start-process-shell-command (name buffer command) ...)
+```
+
+The `start-process` function on the other hand has &rest parameters
+and can be called with a list of arguments.
+
+```
+(defun start-process (name buffer program &rest program-args) ...)
+```
+
+This PR fixes the issue by concatenating the command and it's argument
+before calling out to `deferred:process-buffer-gen`, which is used in
+both cases, when calling `start-process-shell-command`, and when
+calling `start-process`.
+---
+ deferred.el | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/deferred.el b/deferred.el
+index 041c90b..3092ac0 100644
+--- a/deferred.el
++++ b/deferred.el
+@@ -754,7 +754,7 @@ object. The process name and buffer name of the argument 
of the
+ `start-process-shell-command' are generated by this function automatically.
+ The next deferred object receives stdout and stderr string from
+ the command process."
+-  (deferred:process-gen 'start-process-shell-command command args))
++  (deferred:process-gen 'start-process-shell-command  (string-join (cons 
command args) " ") nil))
+ 
+ (defun deferred:process-buffer (command &rest args)
+   "A deferred wrapper of `start-process'. Return a deferred
+@@ -770,7 +770,7 @@ object. The process name and buffer name of the argument 
of the
+ `start-process-shell-command' are generated by this function automatically.
+ The next deferred object receives stdout and stderr buffer from
+ the command process."
+-  (deferred:process-buffer-gen 'start-process-shell-command command args))
++  (deferred:process-buffer-gen 'start-process-shell-command (string-join 
(cons command args) " ") nil))
+ 
+ (defun deferred:process-gen (f command args)
+   "[internal]"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]