From fa660e831869833ae0f1c01a745b6a64b2f188f9 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 19 Nov 1999 13:16:05 +0000 Subject: [PATCH] (copy-list): New function defined by `defun-maybe'. --- lisp/gnus-util.el | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 1.7.10.4