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 r99769: * files.el (copy-directory


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r99769: * files.el (copy-directory): Handle symlinks (Bug#5982).
Date: Tue, 20 Apr 2010 18:28:26 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99769
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Tue 2010-04-20 18:28:26 -0400
message:
  * files.el (copy-directory): Handle symlinks (Bug#5982).
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-04-20 16:04:05 +0000
+++ b/lisp/ChangeLog    2010-04-20 22:28:26 +0000
@@ -1,5 +1,7 @@
 2010-04-20  Chong Yidong  <address@hidden>
 
+       * files.el (copy-directory): Handle symlinks (Bug#5982).
+
        * progmodes/compile.el (compilation-next-error-function): Revert
        2009-10-12 change (Bug#5983).
 

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2010-03-11 16:25:46 +0000
+++ b/lisp/files.el     2010-04-20 22:28:26 +0000
@@ -4735,10 +4735,14 @@
       (mapc
        (lambda (file)
         (let ((target (expand-file-name
-                       (file-name-nondirectory file) newname)))
-          (if (file-directory-p file)
-              (copy-directory file target keep-time parents)
-            (copy-file file target t keep-time))))
+                       (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))
 


reply via email to

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