[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9a82294 26/39: DRY use apply.
From: |
Thierry Volpiatto |
Subject: |
[elpa] master 9a82294 26/39: DRY use apply. |
Date: |
Wed, 18 May 2016 18:02:53 +0000 (UTC) |
branch: master
commit 9a82294528eb8752898ab6c130ec575db11ab687
Author: Thierry Volpiatto <address@hidden>
Commit: Thierry Volpiatto <address@hidden>
DRY use apply.
* dired-async.el (dired-async-after-file-create): Do it.
(dired-async-create-files): Do it.
---
dired-async.el | 46 ++++++++++++++++++++++------------------------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/dired-async.el b/dired-async.el
index c18ec53..1865eda 100644
--- a/dired-async.el
+++ b/dired-async.el
@@ -137,18 +137,17 @@ Should take same args as `message'."
0.1 nil
(lambda ()
;; First send error messages.
- (cond (failures
- (funcall dired-async-message-function
- "%s failed for %d of %d file%s"
- 'dired-async-failures
- (car operation) (length failures)
- total (dired-plural-s total)))
- (skipped
- (funcall dired-async-message-function
- "%s: %d of %d file%s skipped"
- 'dired-async-failures
- (car operation) (length skipped) total
- (dired-plural-s total))))
+ (apply dired-async-message-function
+ (cond (failures
+ (list "%s failed for %d of %d file%s"
+ 'dired-async-failures
+ (car operation) (length failures)
+ total (dired-plural-s total)))
+ (skipped
+ (list "%s: %d of %d file%s skipped"
+ 'dired-async-failures
+ (car operation) (length skipped) total
+ (dired-plural-s total)))))
;; Finally send the success message.
(funcall dired-async-message-function
"Asynchronous %s of %s file(s) on %s file(s) done"
@@ -234,18 +233,17 @@ ESC or `q' to not overwrite any of the remaining files,
;; In this case async process will never start and callback
;; will have no chance to run, so notify failures here.
(unless async-fn-list
- (cond (failures
- (funcall dired-async-message-function
- "%s failed for %d of %d file%s"
- 'dired-async-failures
- operation (length failures)
- total (dired-plural-s total)))
- (skipped
- (funcall dired-async-message-function
- "%s: %d of %d file%s skipped"
- 'dired-async-failures
- operation (length skipped) total
- (dired-plural-s total)))))
+ (apply dired-async-message-function
+ (cond (failures
+ (list "%s failed for %d of %d file%s"
+ 'dired-async-failures
+ operation (length failures)
+ total (dired-plural-s total)))
+ (skipped
+ (list "%s: %d of %d file%s skipped"
+ 'dired-async-failures
+ operation (length skipped) total
+ (dired-plural-s total))))))
;; Setup callback.
(setq callback
(lambda (&optional _ignore)
- [elpa] master a48e509 28/39: Ensure a new line is added when printing to dired log buffer., (continued)
- [elpa] master a48e509 28/39: Ensure a new line is added when printing to dired log buffer., Thierry Volpiatto, 2016/05/18
- [elpa] master 4d6efb9 25/39: Handle error also on host when async-list of file is empty., Thierry Volpiatto, 2016/05/18
- [elpa] master 8632abd 39/39: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Thierry Volpiatto, 2016/05/18
- [elpa] master 8d1a26d 29/39: Remove unused commented code., Thierry Volpiatto, 2016/05/18
- [elpa] master 228ec4b 34/39: Handle errors file by file instead of returning on first error., Thierry Volpiatto, 2016/05/18
- [elpa] master 0b8fbed 23/39: Remove commented line, no code change., Thierry Volpiatto, 2016/05/18
- [elpa] master 3ec3fb6 02/39: Declare package-alist in async-bytecomp.., Thierry Volpiatto, 2016/05/18
- [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 <=
- [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, 2016/05/18
- [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