Skip to content

Commit

Permalink
Don't recompute length fn-list, ensure operation is downcased for saf…
Browse files Browse the repository at this point in the history
…ety (#57).

* dired-async.el (dired-async-create-files): Do it.
  • Loading branch information
thierryvolpiatto committed Nov 20, 2015
1 parent 4319ab6 commit 1f12717
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dired-async.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1f12717

Please sign in to comment.