From: yamaoka Date: Fri, 19 Nov 1999 13:16:05 +0000 (+0000) Subject: (copy-list): New function defined by `defun-maybe'. X-Git-Tag: t-gnus-6_13_3-01~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=fa660e831869833ae0f1c01a745b6a64b2f188f9;p=elisp%2Fgnus.git- (copy-list): New function defined by `defun-maybe'. --- diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 8de7434..50e70d0 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -1022,6 +1022,15 @@ ARG is passed to the first function." hashtb)))) ) +(defun-maybe 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))) + (provide 'gnus-util) ;;; gnus-util.el ends here