aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2020-03-22 07:48:14 -0400
committerNoam Postavsky2020-03-22 23:06:31 -0400
commit9ab85f087f7db38168dcf07d24f51ecd2c583f8a (patch)
tree0ae48c0410b18776d4605fe46e303001683ee7d8
parent561e9fb91bba98616f6d7ea3818727c1cdd2d853 (diff)
downloademacs-9ab85f087f7db38168dcf07d24f51ecd2c583f8a.tar.gz
emacs-9ab85f087f7db38168dcf07d24f51ecd2c583f8a.zip
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.
-rw-r--r--lisp/emacs-lisp/cl-extra.el2
-rw-r--r--test/lisp/emacs-lisp/cl-extra-tests.el8
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index e9bfe8df5f2..ce6fb625bc0 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)."
556(defun cl-concatenate (type &rest sequences) 556(defun cl-concatenate (type &rest sequences)
557 "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs. 557 "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
558\n(fn TYPE SEQUENCE...)" 558\n(fn TYPE SEQUENCE...)"
559 (seq-concatenate type sequences)) 559 (apply #'seq-concatenate type sequences))
560 560
561;;; List functions. 561;;; List functions.
562 562
diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el
index 2d20ba75d29..7546c149377 100644
--- a/test/lisp/emacs-lisp/cl-extra-tests.el
+++ b/test/lisp/emacs-lisp/cl-extra-tests.el
@@ -99,4 +99,12 @@
99 ;; Test for Bug#33731. 99 ;; Test for Bug#33731.
100 (should-not (eq s (cl-make-random-state s))))) 100 (should-not (eq s (cl-make-random-state s)))))
101 101
102(ert-deftest cl-concatenate ()
103 (should (equal (cl-concatenate 'list '(1 2 3) '(4 5 6))
104 '(1 2 3 4 5 6)))
105 (should (equal (cl-concatenate 'vector [1 2 3] [4 5 6])
106 [1 2 3 4 5 6]))
107 (should (equal (cl-concatenate 'string "123" "456")
108 "123456")))
109
102;;; cl-extra-tests.el ends here 110;;; cl-extra-tests.el ends here