diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2023-03-12 17:00:25 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2023-03-12 18:12:18 +0100 |
commit | 75f04848a653e70f12f0e5a62b756c5bba0dd204 (patch) | |
tree | d0d857342f3e9078e9e0bec82c1951ce79d17e72 /doc/lispref | |
parent | f5f13495f5dac4148c1da8b0ba18c22daf77bb04 (diff) | |
download | emacs-75f04848a653e70f12f0e5a62b756c5bba0dd204.tar.gz |
Repair and speed up safe-copy-tree and make it internal (bug#61962)
There is no particular requirement for safe-copy-tree so let's make it
internal for now. The new implementation is faster and more correct.
* doc/lispref/lists.texi (Building Lists):
* etc/NEWS: Remove doc and announcement.
* lisp/subr.el (safe-copy-tree--seen, safe-copy-tree--1)
(safe-copy-tree): Remove old version.
* lisp/emacs-lisp/bytecomp.el (bytecomp--copy-tree-seen)
(bytecomp--copy-tree-1, bytecomp--copy-tree): Add new version.
(byte-compile-initial-macro-environment): Use it.
* test/lisp/subr-tests.el (subr--safe-copy-tree):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--copy-tree):
Move and improve tests.
Diffstat (limited to 'doc/lispref')
-rw-r--r-- | doc/lispref/lists.texi | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 3478049c84f..a509325854f 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -708,19 +708,6 @@ non-@code{nil}, it copies vectors too (and operates recursively on their elements). This function cannot cope with circular lists. @end defun -@defun safe-copy-tree tree &optional vecp -This function returns a copy of the tree @var{tree}. If @var{tree} is -a cons cell, this make a new cons cell with the same @sc{car} and -@sc{cdr}, then recursively copies the @sc{car} and @sc{cdr} in the -same way. - -Normally, when @var{tree} is anything other than a cons cell, -@code{copy-tree} simply returns @var{tree}. However, if @var{vecp} is -non-@code{nil}, it copies vectors and records too (and operates -recursively on their elements). This function handles circular lists -and vectors, and is thus slower than @code{copy-tree} for typical cases. -@end defun - @defun flatten-tree tree This function returns a ``flattened'' copy of @var{tree}, that is, a list containing all the non-@code{nil} terminal nodes, or leaves, of |