]> code.delx.au - gnu-emacs-elpa/blobdiff - dired-async.el
Ensure dired-copy-preserve-time is passed to child with its current value.
[gnu-emacs-elpa] / dired-async.el
index 00e17cee26d510c9f135dee0dd5523c0fb077a3b..41f2b795562e301917e186870371462d75808fb7 100644 (file)
@@ -255,19 +255,21 @@ ESC or `q' to not overwrite any of the remaining files,
                       (require 'cl-lib) (require 'dired-aux) (require 'dired-x)
                       ,(async-inject-variables dired-async-env-variables-regexp)
                       (condition-case err
-                          (let ((dired-recursive-copies (quote always)))
+                          (let ((dired-recursive-copies (quote always))
+                                (dired-copy-preserve-time
+                                 ,dired-copy-preserve-time))
                             ;; Inline `backup-file' as long as it is not
                             ;; available in emacs.
                             (defalias 'backup-file
                                 ;; Same feature as "cp --backup=numbered from to"
                                 ;; Symlinks are copied as file from source unlike
                                 ;; `dired-copy-file' which is same as cp -d.
+                                ;; Directories are omitted.
                                 (lambda (from to ok)
-                                  (cond ((eq t (nth 0 (file-attributes from))) (ignore))
+                                  (cond ((file-directory-p from) (ignore))
                                         (t (let ((count 0))
                                              (while (let ((attrs (file-attributes to)))
-                                                      (and attrs
-                                                           (null (nth 0 (file-attributes to)))))
+                                                      (and attrs (null (nth 0 attrs))))
                                                (cl-incf count)
                                                (setq to (concat (file-name-sans-versions to)
                                                                 (format ".~%s~" count)))))