diff options
| author | Michael Albinus | 2009-10-04 12:16:36 +0000 |
|---|---|---|
| committer | Michael Albinus | 2009-10-04 12:16:36 +0000 |
| commit | b4583b8c212d6bba8e7524e635cd8cecf6e8f61b (patch) | |
| tree | 50f5fb65fa2634d3e8f8833416641d877c23fcfb | |
| parent | 8e692050bde478d7db9053847b76493b19f77ee0 (diff) | |
| download | emacs-b4583b8c212d6bba8e7524e635cd8cecf6e8f61b.tar.gz emacs-b4583b8c212d6bba8e7524e635cd8cecf6e8f61b.zip | |
* dired-aux.el (dired-copy-file-recursive): Use it.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/dired-aux.el | 46 |
2 files changed, 7 insertions, 45 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 97962595a99..78a7c638f41 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-10-04 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * files.el (copy-directory): New defun. | ||
| 4 | |||
| 5 | * dired-aux.el (dired-copy-file-recursive): Use it. | ||
| 6 | |||
| 1 | 2009-10-04 Juanma Barranquero <lekktu@gmail.com> | 7 | 2009-10-04 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * cedet/ede/makefile-edit.el (makefile-beginning-of-command) | 9 | * cedet/ede/makefile-edit.el (makefile-beginning-of-command) |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index e179a484ac3..ce93f01d6ca 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -1209,51 +1209,7 @@ Special value `always' suppresses confirmation." | |||
| 1209 | (or (eq recursive 'always) | 1209 | (or (eq recursive 'always) |
| 1210 | (yes-or-no-p (format "Recursive copies of %s? " from)))) | 1210 | (yes-or-no-p (format "Recursive copies of %s? " from)))) |
| 1211 | ;; This is a directory. | 1211 | ;; This is a directory. |
| 1212 | (let ((mode (or (file-modes from) #o700)) | 1212 | (copy-directory from to dired-copy-preserve-time) |
| 1213 | (files | ||
| 1214 | (condition-case err | ||
| 1215 | (directory-files from nil dired-re-no-dot) | ||
| 1216 | (file-error | ||
| 1217 | (push (dired-make-relative from) | ||
| 1218 | dired-create-files-failures) | ||
| 1219 | (dired-log "Copying error for %s:\n%s\n" from err) | ||
| 1220 | (setq dirfailed t) | ||
| 1221 | nil)))) | ||
| 1222 | (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any more. | ||
| 1223 | (unless dirfailed | ||
| 1224 | (if (file-exists-p to) | ||
| 1225 | (or top (dired-handle-overwrite to)) | ||
| 1226 | (condition-case err | ||
| 1227 | ;; We used to call set-file-modes here, but on some | ||
| 1228 | ;; Linux kernels, that returns an error on vfat | ||
| 1229 | ;; filesystems | ||
| 1230 | (let ((default-mode (default-file-modes))) | ||
| 1231 | (unwind-protect | ||
| 1232 | (progn | ||
| 1233 | (set-default-file-modes #o700) | ||
| 1234 | (make-directory to)) | ||
| 1235 | (set-default-file-modes default-mode))) | ||
| 1236 | (file-error | ||
| 1237 | (push (dired-make-relative from) | ||
| 1238 | dired-create-files-failures) | ||
| 1239 | (setq files nil) | ||
| 1240 | (dired-log "Copying error for %s:\n%s\n" from err))))) | ||
| 1241 | (dolist (file files) | ||
| 1242 | (let ((thisfrom (expand-file-name file from)) | ||
| 1243 | (thisto (expand-file-name file to))) | ||
| 1244 | ;; Catch errors copying within a directory, | ||
| 1245 | ;; and report them through the dired log mechanism | ||
| 1246 | ;; just as our caller will do for the top level files. | ||
| 1247 | (condition-case err | ||
| 1248 | (dired-copy-file-recursive | ||
| 1249 | thisfrom thisto | ||
| 1250 | ok-flag preserve-time nil recursive) | ||
| 1251 | (file-error | ||
| 1252 | (push (dired-make-relative thisfrom) | ||
| 1253 | dired-create-files-failures) | ||
| 1254 | (dired-log "Copying error for %s:\n%s\n" thisfrom err))))) | ||
| 1255 | (when (file-directory-p to) | ||
| 1256 | (set-file-modes to mode))) | ||
| 1257 | ;; Not a directory. | 1213 | ;; Not a directory. |
| 1258 | (or top (dired-handle-overwrite to)) | 1214 | (or top (dired-handle-overwrite to)) |
| 1259 | (condition-case err | 1215 | (condition-case err |