emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/eshell/esh-util.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/eshell/esh-util.el
Date: Mon, 10 Jun 2002 04:33:13 -0400

Index: emacs/lisp/eshell/esh-util.el
diff -c emacs/lisp/eshell/esh-util.el:1.14 emacs/lisp/eshell/esh-util.el:1.15
*** emacs/lisp/eshell/esh-util.el:1.14  Sun Jul 15 15:53:53 2001
--- emacs/lisp/eshell/esh-util.el       Mon Jun 10 04:33:13 2002
***************
*** 236,242 ****
  (defun eshell-sublist (l &optional n m)
    "Return from LIST the N to M elements.
  If N or M is nil, it means the end of the list."
!   (let* ((a (eshell-copy-list l))
         result)
      (if (and m (consp (nthcdr m a)))
        (setcdr (nthcdr m a) nil))
--- 236,242 ----
  (defun eshell-sublist (l &optional n m)
    "Return from LIST the N to M elements.
  If N or M is nil, it means the end of the list."
!   (let* ((a (copy-sequence l))
         result)
      (if (and m (consp (nthcdr m a)))
        (setcdr (nthcdr m a) nil))
***************
*** 710,731 ****
                      (setq entry nil)))))))
        (or entry (funcall handler 'file-attributes file)))))
  
- (defun eshell-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 eshell-copy-tree (tree &optional vecp)
    "Make a copy of TREE.
  If TREE is a cons cell, this recursively copies both its car and its cdr.
  Contrast to copy-sequence, which copies only along the cdrs.  With second
  argument VECP, this copies vectors as well as conses."
    (if (consp tree)
!       (let ((p (setq tree (eshell-copy-list tree))))
        (while (consp p)
          (if (or (consp (car p)) (and vecp (vectorp (car p))))
              (setcar p (eshell-copy-tree (car p) vecp)))
--- 710,722 ----
                      (setq entry nil)))))))
        (or entry (funcall handler 'file-attributes file)))))
  
  (defun eshell-copy-tree (tree &optional vecp)
    "Make a copy of TREE.
  If TREE is a cons cell, this recursively copies both its car and its cdr.
  Contrast to copy-sequence, which copies only along the cdrs.  With second
  argument VECP, this copies vectors as well as conses."
    (if (consp tree)
!       (let ((p (setq tree (copy-sequence tree))))
        (while (consp p)
          (if (or (consp (car p)) (and vecp (vectorp (car p))))
              (setcar p (eshell-copy-tree (car p) vecp)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]