Skip to content

Commit 9ab85f0

Browse files
committed
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.
1 parent 561e9fb commit 9ab85f0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lisp/emacs-lisp/cl-extra.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ too large if positive or too small if negative)."
556556
(defun cl-concatenate (type &rest sequences)
557557
"Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
558558
\n(fn TYPE SEQUENCE...)"
559-
(seq-concatenate type sequences))
559+
(apply #'seq-concatenate type sequences))
560560

561561
;;; List functions.
562562

test/lisp/emacs-lisp/cl-extra-tests.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,12 @@
9999
;; Test for Bug#33731.
100100
(should-not (eq s (cl-make-random-state s)))))
101101

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+
102110
;;; cl-extra-tests.el ends here

0 commit comments

Comments
 (0)