From 419ac8148f1fffd7755f3545137a0321914441d9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 7 Feb 2026 14:22:12 +0200 Subject: [PATCH] ; Document creation of strings from copies of other strings * doc/lispref/strings.texi (Creating Strings): Document how to create a string from N copies of another string. (Bug#80256) --- doc/lispref/strings.texi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 44be529d562..d073d3ffe2f 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -281,6 +281,17 @@ another string, alter a constant string in the program, or even raise an error. To obtain a string that you can safely mutate, use @code{copy-sequence} on the result. +If you need to create a string made from @var{n} copies of a given +source string @var{source}, you can use @code{concat} as follows: + +@lisp + (apply #'concat (make-list @var{n} @var{source})) +@end lisp + +@noindent +This uses the fact that @code{concat} can take any kind of sequence as +its arguments. + For information about other concatenation functions, see the description of @code{mapconcat} in @ref{Mapping Functions}, @code{vconcat} in @ref{Vector Functions}, and @code{append} in @ref{Building