# HG changeset patch # User Chong Yidong # Date 1271802506 14400 # Node ID 297d4e80151fc69987aa1f6098e7526a73dc536c # Parent bdf81babd7c57273f3c58179642062f4f21817a0 * files.el (copy-directory): Handle symlinks (Bug#5982). diff -r bdf81babd7c5 -r 297d4e80151f lisp/ChangeLog --- a/lisp/ChangeLog Tue Apr 20 12:04:05 2010 -0400 +++ b/lisp/ChangeLog Tue Apr 20 18:28:26 2010 -0400 @@ -1,5 +1,7 @@ 2010-04-20 Chong Yidong + * files.el (copy-directory): Handle symlinks (Bug#5982). + * progmodes/compile.el (compilation-next-error-function): Revert 2009-10-12 change (Bug#5983). diff -r bdf81babd7c5 -r 297d4e80151f lisp/files.el --- a/lisp/files.el Tue Apr 20 12:04:05 2010 -0400 +++ b/lisp/files.el Tue Apr 20 18:28:26 2010 -0400 @@ -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))