diff options
| author | Eli Zaretskii | 2017-09-30 16:01:00 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-09-30 16:01:00 +0300 |
| commit | cb93a6ce72c5d238c6f120192aaba1554363dfe9 (patch) | |
| tree | bd13ee6c2c31b775b9f5e3b701333e09d37ef74c | |
| parent | 200ef6f7213bdd1db314ae3cf66fab6d5caaf1e6 (diff) | |
| download | emacs-cb93a6ce72c5d238c6f120192aaba1554363dfe9.tar.gz emacs-cb93a6ce72c5d238c6f120192aaba1554363dfe9.zip | |
Improve documentation of 'copy-sequence'
* src/fns.c (Fcopy_sequence):
* doc/lispref/sequences.texi (Sequence Functions): Mention the
exception when copying an empty sequence. (Bug#28627)
| -rw-r--r-- | doc/lispref/sequences.texi | 5 | ||||
| -rw-r--r-- | src/fns.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index c7cf9f5e1af..5ae1567c128 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi | |||
| @@ -155,7 +155,10 @@ This function generalizes @code{aref} (@pxref{Array Functions}) and | |||
| 155 | @cindex copying sequences | 155 | @cindex copying sequences |
| 156 | This function returns a copy of @var{seqr}, which should be either a | 156 | This function returns a copy of @var{seqr}, which should be either a |
| 157 | sequence or a record. The copy is the same type of object as the | 157 | sequence or a record. The copy is the same type of object as the |
| 158 | original, and it has the same elements in the same order. | 158 | original, and it has the same elements in the same order. However, if |
| 159 | @var{seqr} is empty, like a string or a vector of zero length, the | ||
| 160 | value returned by this function might not be a copy, but an empty | ||
| 161 | object of the same type and identical to @var{seqr}. | ||
| 159 | 162 | ||
| 160 | Storing a new element into the copy does not affect the original | 163 | Storing a new element into the copy does not affect the original |
| 161 | @var{seqr}, and vice versa. However, the elements of the copy | 164 | @var{seqr}, and vice versa. However, the elements of the copy |
| @@ -482,7 +482,9 @@ usage: (vconcat &rest SEQUENCES) */) | |||
| 482 | DEFUN ("copy-sequence", Fcopy_sequence, Scopy_sequence, 1, 1, 0, | 482 | DEFUN ("copy-sequence", Fcopy_sequence, Scopy_sequence, 1, 1, 0, |
| 483 | doc: /* Return a copy of a list, vector, string, char-table or record. | 483 | doc: /* Return a copy of a list, vector, string, char-table or record. |
| 484 | The elements of a list, vector or record are not copied; they are | 484 | The elements of a list, vector or record are not copied; they are |
| 485 | shared with the original. */) | 485 | shared with the original. |
| 486 | If the original sequence is empty, this function may return | ||
| 487 | the same empty object instead of its copy. */) | ||
| 486 | (Lisp_Object arg) | 488 | (Lisp_Object arg) |
| 487 | { | 489 | { |
| 488 | if (NILP (arg)) return arg; | 490 | if (NILP (arg)) return arg; |