diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-05-11 21:10:36 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-05-11 21:10:36 +0200 |
commit | 54846c545be4468f8b2aa8ffb91c4e2101dd0acb (patch) | |
tree | 7adf0c3fc81e1e530e8923209d5767eeaf8210ba /helm-files.el | |
parent | 8b52cec3459ae8dd6457a0018b2c32a023ea60ad (diff) |
* helm-files.el: Handle new dired-async-mode.
Diffstat (limited to 'helm-files.el')
-rw-r--r-- | helm-files.el | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/helm-files.el b/helm-files.el index 89790c6a..5b6c4d6b 100644 --- a/helm-files.el +++ b/helm-files.el @@ -2384,7 +2384,7 @@ Find inside `require' and `declare-function' sexp." ;;; Handle copy, rename, symlink, relsymlink and hardlink from helm. ;; ;; -(defvar dired-async-be-async) +(defvar dired-async-mode) (cl-defun helm-dired-action (candidate &key action follow (files (dired-get-marked-files))) "Execute ACTION on FILES to CANDIDATE. @@ -2407,21 +2407,21 @@ copy and rename." (dirflag (and (= (length files) 1) (file-directory-p (car files)) (not (file-directory-p candidate)))) - ;; When FOLLOW is enabled, disable helm-async. - ;; If it is globally disabled use this nil value. - (dired-async-be-async (and (boundp 'dired-async-be-async) - dired-async-be-async - (not follow)))) - (dired-create-files - fn (symbol-name action) files - ;; CANDIDATE is the destination. - (if (file-directory-p candidate) - ;; When CANDIDATE is a directory, build file-name in this directory. - ;; Else we use CANDIDATE. - #'(lambda (from) - (expand-file-name (file-name-nondirectory from) candidate)) - #'(lambda (_from) candidate)) - marker) + (dired-async-state (if dired-async-mode 1 -1))) + (and follow (fboundp 'dired-async-mode) (dired-async-mode -1)) + (unwind-protect + (dired-create-files + fn (symbol-name action) files + ;; CANDIDATE is the destination. + (if (file-directory-p candidate) + ;; When CANDIDATE is a directory, build file-name in this directory. + ;; Else we use CANDIDATE. + #'(lambda (from) + (expand-file-name (file-name-nondirectory from) candidate)) + #'(lambda (_from) candidate)) + marker) + (and (fboundp 'dired-async-mode) + (dired-async-mode dired-async-state))) (push (file-name-as-directory (if (file-directory-p candidate) (expand-file-name candidate) |