diff options
author | Richard M. Stallman <rms@gnu.org> | 2002-06-10 09:00:52 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2002-06-10 09:00:52 +0000 |
commit | 6b25a2f544161b04915807a873af060fcb6bdc49 (patch) | |
tree | d93ea552b795c8e2d60d7d74b56996c6f2e04678 /lisp/emacs-lisp/cl.el | |
parent | 37ce10ea26089aa0908a9ecfa47b0032e10797db (diff) | |
download | emacs-6b25a2f544161b04915807a873af060fcb6bdc49.tar.gz emacs-6b25a2f544161b04915807a873af060fcb6bdc49.tar.bz2 emacs-6b25a2f544161b04915807a873af060fcb6bdc49.zip |
(copy-list): Moved back from subr.el.
Diffstat (limited to 'lisp/emacs-lisp/cl.el')
-rw-r--r-- | lisp/emacs-lisp/cl.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index def4d24188c..c5d3ef0832e 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -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) |