From 1f127172225467c5b5f0df08d84e1a5e18990f0e Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Fri, 20 Nov 2015 11:28:42 +0100 Subject: [PATCH] Don't recompute length fn-list, ensure operation is downcased for safety (#57). * dired-async.el (dired-async-create-files): Do it. --- dired-async.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dired-async.el b/dired-async.el index 01d1a8fa8..3f5349dad 100644 --- a/dired-async.el +++ b/dired-async.el @@ -153,7 +153,8 @@ See `dired-create-files' for the behavior of arguments." (setq dired-async-operation nil) (let (dired-create-files-failures failures async-fn-list - skipped (success-count 0) (total (length fn-list)) + skipped (success-count 0) + (total (length fn-list)) callback) (let (to overwrite-query overwrite-backup-query) ; for dired-handle-overwrite @@ -218,8 +219,8 @@ ESC or `q' to not overwrite any of the remaining files, (push (cons from to) async-fn-list))))) (setq callback `(lambda (&optional ignore) - (dired-async-after-file-create ,(length fn-list)) - (when (string= ,operation "rename") + (dired-async-after-file-create ,total) + (when (string= ,(downcase operation) "rename") (cl-loop for (file . to) in ',async-fn-list do (and (get-file-buffer file) (with-current-buffer (get-file-buffer file) -- 2.39.2