emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100436: * lisp/files.el (copy-dir


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100436: * lisp/files.el (copy-directory): Fix arguments to the recursive call.
Date: Mon, 31 Jan 2011 12:03:37 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100436
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Mon 2011-01-31 12:03:37 -0500
message:
  * lisp/files.el (copy-directory): Fix arguments to the recursive call.
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-01-29 22:10:51 +0000
+++ b/lisp/ChangeLog    2011-01-31 17:03:37 +0000
@@ -1,3 +1,7 @@
+2011-01-31  Chong Yidong  <address@hidden>
+
+       * files.el (copy-directory): Fix arguments to recursive call.
+
 2011-01-29  Chong Yidong  <address@hidden>
 
        * files.el (copy-directory): If destination is an existing

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2011-01-29 22:10:51 +0000
+++ b/lisp/files.el     2011-01-31 17:03:37 +0000
@@ -4767,26 +4767,24 @@
                       (file-name-nondirectory
                        (directory-file-name directory))
                       newname))
-       (if (and (file-exists-p newname)
-                (not (file-directory-p newname)))
-           (error "Cannot overwrite non-directory %s with a directory"
-                  newname))
+       (and (file-exists-p newname)
+            (not (file-directory-p newname))
+            (error "Cannot overwrite non-directory %s with a directory"
+                   newname))
        (make-directory newname t))
 
       ;; Copy recursively.
-      (mapc
-       (lambda (file)
-        (let ((target (expand-file-name
-                       (file-name-nondirectory file) newname))
-              (attrs (file-attributes file)))
-          (cond ((file-directory-p file)
-                 (copy-directory file target keep-time parents))
-                ((stringp (car attrs)) ; Symbolic link
-                 (make-symbolic-link (car attrs) target t))
-                (t
-                 (copy-file file target t keep-time)))))
-       ;; We do not want to copy "." and "..".
-       (directory-files        directory 'full 
directory-files-no-dot-files-regexp))
+      (dolist (file
+              ;; We do not want to copy "." and "..".
+              (directory-files directory 'full
+                               directory-files-no-dot-files-regexp))
+       (if (file-directory-p file)
+           (copy-directory file newname keep-time parents)
+         (let ((target (expand-file-name (file-name-nondirectory file) 
newname))
+               (attrs (file-attributes file)))
+           (if (stringp (car attrs)) ; Symbolic link
+               (make-symbolic-link (car attrs) target t)
+             (copy-file file target t keep-time)))))
 
       ;; Set directory attributes.
       (set-file-modes newname (file-modes directory))


reply via email to

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