[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master cd901e7 12/39: Improve backup-files by handling symlinks a
From: |
Thierry Volpiatto |
Subject: |
[elpa] master cd901e7 12/39: Improve backup-files by handling symlinks and time-stamp errors. |
Date: |
Wed, 18 May 2016 18:02:51 +0000 (UTC) |
branch: master
commit cd901e7e90e79c3f6f6c8abd7e065481194bda78
Author: Thierry Volpiatto <address@hidden>
Commit: Thierry Volpiatto <address@hidden>
Improve backup-files by handling symlinks and time-stamp errors.
* dired-async.el (dired-async-create-files): Rework backup-files.
---
dired-async.el | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/dired-async.el b/dired-async.el
index 461e1dd..00e17ce 100644
--- a/dired-async.el
+++ b/dired-async.el
@@ -256,18 +256,28 @@ ESC or `q' to not overwrite any of the remaining files,
,(async-inject-variables
dired-async-env-variables-regexp)
(condition-case err
(let ((dired-recursive-copies (quote always)))
+ ;; 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.
(lambda (from to ok)
- (when (null (nth 0 (file-attributes from)))
- (let ((count 0))
- (while (let ((attrs (file-attributes
to)))
- (and attrs
- (null (nth 0
(file-attributes to)))))
- (cl-incf count)
- (setq to (concat
(file-name-sans-versions to)
- (format ".~%s~"
count)))))
- (copy-file from to ok
dired-copy-preserve-time))))
+ (cond ((eq t (nth 0 (file-attributes from)))
(ignore))
+ (t (let ((count 0))
+ (while (let ((attrs
(file-attributes to)))
+ (and attrs
+ (null (nth 0
(file-attributes to)))))
+ (cl-incf count)
+ (setq to (concat
(file-name-sans-versions to)
+ (format
".~%s~" count)))))
+ (condition-case err
+ (copy-file from to ok
dired-copy-preserve-time)
+ (file-date-error
+ (push (dired-make-relative from)
+
dired-create-files-failures)
+ (dired-log "Can't set date on
%s:\n%s\n" from err)))))))
+ ;; Now run the FILE-CREATOR function on files.
(cl-loop with fn = (quote ,file-creator)
for (from . dest) in (quote
,async-fn-list)
do (funcall fn from dest t)))
- [elpa] master dd77b81 22/39: Fix formatting the help form in dired-create-files., (continued)
- [elpa] master dd77b81 22/39: Fix formatting the help form in dired-create-files., Thierry Volpiatto, 2016/05/18
- [elpa] master 8d27590 21/39: Finally handle the failures correctly., Thierry Volpiatto, 2016/05/18
- [elpa] master 1763517 14/39: Add comment no code change., Thierry Volpiatto, 2016/05/18
- [elpa] master 9a82294 26/39: DRY use apply., Thierry Volpiatto, 2016/05/18
- [elpa] master 1c57dc3 31/39: Better handling of errors happening on child., Thierry Volpiatto, 2016/05/18
- [elpa] master dd09794 33/39: Fix success message on callback., Thierry Volpiatto, 2016/05/18
- [elpa] master 14170a4 35/39: Add more info in mode-line on failures., Thierry Volpiatto, 2016/05/18
- [elpa] master 6e29e82 17/39: Switch to lexical-binding., Thierry Volpiatto, 2016/05/18
- [elpa] master 0e327f7 37/39: Update version number here too., Thierry Volpiatto, 2016/05/18
- [elpa] master 6521911 07/39: Merge pull request #59 from kolewu/kolewu-fix-typo-1, Thierry Volpiatto, 2016/05/18
- [elpa] master cd901e7 12/39: Improve backup-files by handling symlinks and time-stamp errors.,
Thierry Volpiatto <=
- [elpa] master e8db6cc 36/39: Update pkg file., Thierry Volpiatto, 2016/05/18
- [elpa] master 527c590 38/39: Merge commit '0e327f72bdffc5bc4a1fbc34a8da1b7066e819b3', Thierry Volpiatto, 2016/05/18
- [elpa] master 4c4eba9 19/39: Fix repetition in callback., Thierry Volpiatto, 2016/05/18
- [elpa] master 6552135 32/39: Improve how error buffer is displayed., Thierry Volpiatto, 2016/05/18
- [elpa] master d1cc5e0 04/39: Fix UTF-8 encoding for strings passed to subordinate Emacs, Thierry Volpiatto, 2016/05/18