1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 00:00:39 -08:00

Fix circular list handling in seq-mapn

* lisp/emacs-lisp/seq.el (seq-mapn): Do not copy list arguments.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-mapn-circular-lists):
  Add a regression test.
This commit is contained in:
Nicolas Petton 2016-12-15 10:24:57 +01:00
parent acbe32abdd
commit 09a66ceb5e
2 changed files with 9 additions and 1 deletions

View file

@ -178,7 +178,10 @@ Return a list of the results.
\(fn FUNCTION SEQUENCES...)"
(let ((result nil)
(sequences (seq-map (lambda (s) (seq-into s 'list))
(sequences (seq-map (lambda (s)
(if (listp s)
s
(seq-into s 'list)))
(cons sequence sequences))))
(while (not (memq nil sequences))
(push (apply function (seq-map #'car sequences)) result)