aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Mackenzie2023-03-07 08:00:25 +0000
committerAlan Mackenzie2023-03-07 08:00:25 +0000
commitfa83b236111ea024b75a8bb33b78a99f437a9a67 (patch)
treed288fbdbdfb57f173ffb06c6b832c3ce7b201a4d /doc
parent8179555730d23f43b3043df0bfecc9f9c4f36eda (diff)
downloademacs-fa83b236111ea024b75a8bb33b78a99f437a9a67.tar.gz
emacs-fa83b236111ea024b75a8bb33b78a99f437a9a67.zip
eval-and-compile: Strip symbol positions for eval but not for compile.
This fixes bug #61962. * lisp/subr.el (safe-copy-tree): New function. * lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment): Amend the entry for eval-and-compile to use safe-copy-tree and byte-run-strip-symbol-positions for the eval part. * doc/lispref/lists.texi (Building Lists): Document safe-copy-tree. * etc/NEWS: Note the new function safe-copy-tree.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/lists.texi14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index f3758f5ce60..911defbc211 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -705,9 +705,21 @@ same way.
705Normally, when @var{tree} is anything other than a cons cell, 705Normally, when @var{tree} is anything other than a cons cell,
706@code{copy-tree} simply returns @var{tree}. However, if @var{vecp} is 706@code{copy-tree} simply returns @var{tree}. However, if @var{vecp} is
707non-@code{nil}, it copies vectors too (and operates recursively on 707non-@code{nil}, it copies vectors too (and operates recursively on
708their elements). 708their elements). This function cannot cope with circular lists.
709@end defun 709@end defun
710 710
711@defun safe-copy-tree tree &optional vecp
712This function returns a copy of the tree @var{tree}. If @var{tree} is
713a cons cell, this make a new cons cell with the same @sc{car} and
714@sc{cdr}, then recursively copies the @sc{car} and @sc{cdr} in the
715same way.
716
717Normally, when @var{tree} is anything other than a cons cell,
718@code{copy-tree} simply returns @var{tree}. However, if @var{vecp} is
719non-@code{nil}, it copies vectors and records too (and operates
720recursively on their elements). This function handles circular lists
721and vectors, and is thus slower than @code{copy-tree} for typical cases.
722
711@defun flatten-tree tree 723@defun flatten-tree tree
712This function returns a ``flattened'' copy of @var{tree}, that is, 724This function returns a ``flattened'' copy of @var{tree}, that is,
713a list containing all the non-@code{nil} terminal nodes, or leaves, of 725a list containing all the non-@code{nil} terminal nodes, or leaves, of