emacs-diffs
[Top][All Lists]
Advanced

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

emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180)


From: Noam Postavsky
Subject: emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180)
Date: Sun, 22 Mar 2020 23:13:45 -0400 (EDT)

branch: emacs-27
commit 9ab85f087f7db38168dcf07d24f51ecd2c583f8a
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Fix cl-concatenate (Bug#40180)
    
    * lisp/emacs-lisp/cl-extra.el (cl-concatenate): Use apply, to avoid
    adding extra nesting of args.
    * test/lisp/emacs-lisp/cl-extra-tests.el (cl-concatenate): New test.
---
 lisp/emacs-lisp/cl-extra.el            | 2 +-
 test/lisp/emacs-lisp/cl-extra-tests.el | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index e9bfe8d..ce6fb62 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -556,7 +556,7 @@ too large if positive or too small if negative)."
 (defun cl-concatenate (type &rest sequences)
   "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
 \n(fn TYPE SEQUENCE...)"
-  (seq-concatenate type sequences))
+  (apply #'seq-concatenate type sequences))
 
 ;;; List functions.
 
diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el 
b/test/lisp/emacs-lisp/cl-extra-tests.el
index 2d20ba7..7546c14 100644
--- a/test/lisp/emacs-lisp/cl-extra-tests.el
+++ b/test/lisp/emacs-lisp/cl-extra-tests.el
@@ -99,4 +99,12 @@
     ;; Test for Bug#33731.
     (should-not (eq s (cl-make-random-state s)))))
 
+(ert-deftest cl-concatenate ()
+  (should (equal (cl-concatenate 'list '(1 2 3) '(4 5 6))
+                 '(1 2 3 4 5 6)))
+  (should (equal (cl-concatenate 'vector [1 2 3] [4 5 6])
+                 [1 2 3 4 5 6]))
+  (should (equal (cl-concatenate 'string "123" "456")
+                 "123456")))
+
 ;;; cl-extra-tests.el ends here



reply via email to

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