mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-04 11:00:45 -08:00
(copy-list): Moved back from subr.el.
This commit is contained in:
parent
37ce10ea26
commit
6b25a2f544
1 changed files with 9 additions and 0 deletions
|
|
@ -514,6 +514,15 @@ Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to
|
|||
(push (pop list) res))
|
||||
(nreverse res)))
|
||||
|
||||
(defun copy-list (list)
|
||||
"Return a copy of a list, which may be a dotted list.
|
||||
The elements of the list are not copied, just the list structure itself."
|
||||
(if (consp list)
|
||||
(let ((res nil))
|
||||
(while (consp list) (push (pop list) res))
|
||||
(prog1 (nreverse res) (setcdr res list)))
|
||||
(car list)))
|
||||
|
||||
(defun cl-maclisp-member (item list)
|
||||
(while (and list (not (equal item (car list)))) (setq list (cdr list)))
|
||||
list)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue