diff options
| -rw-r--r-- | doc/lispref/strings.texi | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 4a7bda57c4e..0dc47f30c43 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -248,7 +248,7 @@ properties removed. | |||
| 248 | @defun concat &rest sequences | 248 | @defun concat &rest sequences |
| 249 | @cindex copying strings | 249 | @cindex copying strings |
| 250 | @cindex concatenating strings | 250 | @cindex concatenating strings |
| 251 | This function returns a new string consisting of the characters in the | 251 | This function returns a string consisting of the characters in the |
| 252 | arguments passed to it (along with their text properties, if any). The | 252 | arguments passed to it (along with their text properties, if any). The |
| 253 | arguments may be strings, lists of numbers, or vectors of numbers; they | 253 | arguments may be strings, lists of numbers, or vectors of numbers; they |
| 254 | are not themselves changed. If @code{concat} receives no arguments, it | 254 | are not themselves changed. If @code{concat} receives no arguments, it |
| @@ -269,9 +269,14 @@ returns an empty string. | |||
| 269 | @end example | 269 | @end example |
| 270 | 270 | ||
| 271 | @noindent | 271 | @noindent |
| 272 | This function always constructs a new string that is not @code{eq} to | 272 | This function does not always allocate a new string. Callers are |
| 273 | any existing string, except when the result is the empty string (to | 273 | advised not rely on the result being a new string nor on it being |
| 274 | save space, Emacs makes only one empty multibyte string). | 274 | @code{eq} to an existing string. |
| 275 | |||
| 276 | In particular, mutating the returned value may inadvertently change | ||
| 277 | another string, alter a constant string in the program, or even raise | ||
| 278 | an error. To obtain a string that you can safely mutate, use | ||
| 279 | @code{copy-sequence} on the result. | ||
| 275 | 280 | ||
| 276 | For information about other concatenation functions, see the | 281 | For information about other concatenation functions, see the |
| 277 | description of @code{mapconcat} in @ref{Mapping Functions}, | 282 | description of @code{mapconcat} in @ref{Mapping Functions}, |