diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-03-09 07:49:33 +0000 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-03-09 07:49:33 +0000 |
commit | 87ee6ff4eb6df369965f37fba073e3ef1bb5d0bd (patch) | |
tree | 2af79516bca28e875879e01cb45b16fa4525a905 /lisp/emacs-lisp/seq.el | |
parent | 9838ee7ed870844470703b2648f8b59c0575bd46 (diff) | |
parent | a461baae79af3cea8780e9d9a845a1e859e96e5e (diff) | |
download | emacs-87ee6ff4eb6df369965f37fba073e3ef1bb5d0bd.tar.gz emacs-87ee6ff4eb6df369965f37fba073e3ef1bb5d0bd.tar.bz2 emacs-87ee6ff4eb6df369965f37fba073e3ef1bb5d0bd.zip |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/emacs-lisp/seq.el')
-rw-r--r-- | lisp/emacs-lisp/seq.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 0b946dd7365..e3037a71901 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -58,6 +58,10 @@ (eval-when-compile (require 'cl-generic)) +;; We used to use some sequence functions from cl-lib, but this +;; dependency was swapped around so that it will be easier to make +;; seq.el preloaded in the future. See also Bug#39761#26. + (defmacro seq-doseq (spec &rest body) "Loop over a sequence. Evaluate BODY with VAR bound to each element of SEQUENCE, in turn. @@ -285,7 +289,11 @@ sorted. FUNCTION must be a function of one argument." TYPE must be one of following symbols: vector, string or list. \n(fn TYPE SEQUENCE...)" - (apply #'cl-concatenate type (seq-map #'seq-into-sequence sequences))) + (pcase type + ('vector (apply #'vconcat sequences)) + ('string (apply #'concat sequences)) + ('list (apply #'append (append sequences '(nil)))) + (_ (error "Not a sequence type name: %S" type)))) (cl-defgeneric seq-into-sequence (sequence) "Convert SEQUENCE into a sequence. |