diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 17 |
2 files changed, 21 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee4eae0e41b..286f1eeae65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-01-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * files.el (copy-directory): If destination is an existing | ||
| 4 | directory, copy into a subdirectory there. | ||
| 5 | |||
| 1 | 2011-01-29 Andreas Schwab <schwab@linux-m68k.org> | 6 | 2011-01-29 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 7 | ||
| 3 | * emacs-lisp/shadow.el (load-path-shadows-find): Ignore leim-list | 8 | * emacs-lisp/shadow.el (load-path-shadows-find): Ignore leim-list |
diff --git a/lisp/files.el b/lisp/files.el index ee77975e38b..46597426191 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -4756,7 +4756,22 @@ this happens by default." | |||
| 4756 | ;; Compute target name. | 4756 | ;; Compute target name. |
| 4757 | (setq directory (directory-file-name (expand-file-name directory)) | 4757 | (setq directory (directory-file-name (expand-file-name directory)) |
| 4758 | newname (directory-file-name (expand-file-name newname))) | 4758 | newname (directory-file-name (expand-file-name newname))) |
| 4759 | (if (not (file-directory-p newname)) (make-directory newname parents)) | 4759 | |
| 4760 | (if (not (file-directory-p newname)) | ||
| 4761 | ;; If NEWNAME is not an existing directory, create it; that | ||
| 4762 | ;; is where we will copy the files of DIRECTORY. | ||
| 4763 | (make-directory newname parents) | ||
| 4764 | ;; If NEWNAME is an existing directory, we will copy into | ||
| 4765 | ;; NEWNAME/[DIRECTORY-BASENAME]. | ||
| 4766 | (setq newname (expand-file-name | ||
| 4767 | (file-name-nondirectory | ||
| 4768 | (directory-file-name directory)) | ||
| 4769 | newname)) | ||
| 4770 | (if (and (file-exists-p newname) | ||
| 4771 | (not (file-directory-p newname))) | ||
| 4772 | (error "Cannot overwrite non-directory %s with a directory" | ||
| 4773 | newname)) | ||
| 4774 | (make-directory newname t)) | ||
| 4760 | 4775 | ||
| 4761 | ;; Copy recursively. | 4776 | ;; Copy recursively. |
| 4762 | (mapc | 4777 | (mapc |