Mercurial > emacs
changeset 105346:57afd13b64b9
*** empty log message ***
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Thu, 01 Oct 2009 15:01:32 +0000 |
parents | e6f58264030b |
children | 667ddf91d885 |
files | lisp/dired.el |
diffstat | 1 files changed, 12 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/dired.el Thu Oct 01 14:33:58 2009 +0000 +++ b/lisp/dired.el Thu Oct 01 15:01:32 2009 +0000 @@ -2526,23 +2526,19 @@ `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.