From 56808ea036393fbb57d9b07bb1f78bb61b2098ed Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 1 Oct 2009 15:01:32 +0000 Subject: [PATCH] *** empty log message *** --- lisp/dired.el | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 1785c787e7b..e0843943f90 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2526,23 +2526,19 @@ nil, do not delete. `always', delete recursively without asking. `top', ask for each directory at top level. Anything else, ask for each sub-directory." - (let (files) - ;; This test is equivalent to - ;; (and (file-directory-p fn) (not (file-symlink-p fn))) - ;; but more efficient - (if (not (eq t (car (file-attributes file)))) - (delete-file file) - (when (and recursive - (setq files - (directory-files file t dired-re-no-dot)) ; Not empty. - (or (eq recursive 'always) - (yes-or-no-p (format "Recursive delete of %s? " - (dired-make-relative file))))) + ;; This test is equivalent to + ;; (and (file-directory-p fn) (not (file-symlink-p fn))) + ;; but more efficient + (if (not (eq t (car (file-attributes file)))) + (delete-file file) + (if (and recursive + (directory-files file t dired-re-no-dot) ; Not empty. + (or (eq recursive 'always) + (yes-or-no-p (format "Recursive delete of %s? " + (dired-make-relative file))))) (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask again. - (while files ; Recursively delete (possibly asking). - (dired-delete-file (car files) recursive) - (setq files (cdr files)))) - (delete-directory file)))) + (setq recursive nil)) + (delete-directory file recursive))) (defun dired-do-flagged-delete (&optional nomessage) "In Dired, delete the files flagged for deletion.