summaryrefslogtreecommitdiff
path: root/helm-files.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2013-02-25 11:48:14 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2013-02-25 11:48:14 +0100
commite8254f58cbcd5dce78a33b86de81589e171dcebc (patch)
tree309dfb8ec7bba86a920f8d13eea9f298b1ed4e23 /helm-files.el
parent43e5483b436f7e850ef7e22e17e398536e7348db (diff)
* helm-files.el (helm-ff-quick-delete): Handle marked files, simplify.
Diffstat (limited to 'helm-files.el')
-rw-r--r--helm-files.el40
1 files changed, 12 insertions, 28 deletions
diff --git a/helm-files.el b/helm-files.el
index 4a608268..333d533b 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -184,11 +184,6 @@ This can be toggled at anytime from `helm-find-files' with \
:type 'boolean
:group 'helm-files)
-(defcustom helm-ff-quick-delete-dont-prompt-for-deletion nil
- "Don't ask in persistent deletion of files when non--nil."
- :group 'helm-files
- :type 'boolean)
-
(defcustom helm-ff-signal-error-on-dot-files t
"Signal error when file is `.' or `..' on file deletion when non--nil.
Default is non--nil.
@@ -1554,29 +1549,18 @@ Note that only directories are saved here."
(defun helm-ff-quick-delete (candidate)
"Delete file CANDIDATE without quitting."
- (let ((presel (prog1 (save-excursion
- (let (sel)
- (helm-next-line)
- (setq sel (helm-get-selection))
- (if (string= sel candidate)
- (progn (helm-previous-line)
- (helm-get-selection))
- sel)))
- (helm-mark-current-line))))
- (setq presel (if (and helm-ff-transformer-show-only-basename
- (not (helm-ff-dot-file-p presel)))
- (helm-c-basename presel) presel))
- (if helm-ff-quick-delete-dont-prompt-for-deletion
- (helm-c-delete-file candidate
- helm-ff-signal-error-on-dot-files
- 'synchro)
- (save-selected-window
- (when (y-or-n-p (format "Really Delete file `%s'? " candidate))
- (helm-c-delete-file candidate
- helm-ff-signal-error-on-dot-files
- 'synchro)
- (message nil))))
- (helm-force-update presel)))
+ (let ((marked (helm-marked-candidates)))
+ (save-selected-window
+ (loop for c in marked do
+ (progn (helm-preselect (if (and helm-ff-transformer-show-only-basename
+ (not (helm-ff-dot-file-p c)))
+ (helm-c-basename c) c))
+ (when (y-or-n-p (format "Really Delete file `%s'? " c))
+ (helm-c-delete-file c helm-ff-signal-error-on-dot-files
+ 'synchro)
+ (helm-delete-current-selection)
+ (message nil)))))
+ (helm-force-update)))
(defun helm-ff-kill-buffer-fname (candidate)
(let* ((buf (get-file-buffer candidate))