Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b8b45afc
Commit
b8b45afc
authored
Jan 12, 2010
by
Michael Albinus
Browse files
* files.el (copy-directory): Compute target for recursive
directories with identical names. (Bug#5343)
parent
832fdcab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/files.el
lisp/files.el
+6
-9
No files found.
lisp/ChangeLog
View file @
b8b45afc
2010-01-12 Michael Albinus <michael.albinus@gmx.de>
* files.el (copy-directory): Compute target for recursive
directories with identical names. (Bug#5343)
2010-01-12 Glenn Morris <rgm@gnu.org>
* mail/emacsbug.el (report-emacs-bug-pretest-address): Set
...
...
lisp/files.el
View file @
b8b45afc
...
...
@@ -4714,20 +4714,17 @@ this happens by default."
;; Compute target name.
(setq directory (directory-file-name (expand-file-name directory))
newname (directory-file-name (expand-file-name newname)))
(if (and (file-directory-p newname)
(not (string-equal (file-name-nondirectory directory)
(file-name-nondirectory newname))))
(setq newname
(expand-file-name (file-name-nondirectory directory) newname)))
(if (not (file-directory-p newname)) (make-directory newname parents))
;; Copy recursively.
(mapc
(lambda (file)
(if (file-directory-p file)
(copy-directory file newname keep-time parents)
(copy-file file newname t keep-time)))
;; We do not want to delete "." and "..".
(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))))
;; We do not want to copy "." and "..".
(directory-files directory 'full directory-files-no-dot-files-regexp))
;; Set directory attributes.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment