GNU bug report logs - #27940
Recursively delete dir34? (yes, no, all, quit)

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Fri, 4 Aug 2017 00:38:01 UTC

Severity: wishlist

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 27940 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: bug#27940: Recursively delete dir34? (yes, no, all, quit)
Date: Fri, 04 Aug 2017 15:46:28 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Cc: 27940 <at> debbugs.gnu.org,  jidanni <at> jidanni.org
> Date: Fri, 04 Aug 2017 18:29:41 +0900
> 
> index 24759c6c9b..278acc2cf5 100644
> --- a/lisp/dired.el
> +++ b/lisp/dired.el
> @@ -2990,23 +2990,33 @@ dired-delete-file
>  
>  TRASH non-nil means to trash the file instead of deleting, provided
>  `delete-by-moving-to-trash' (which see) is non-nil."
> -  ;; 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 trash)
> -    (if (and recursive
> -	     (directory-files file t dired-re-no-dot) ; Not empty.
> -	     (or (eq recursive 'always)
> -		 (yes-or-no-p (format "Recursively %s %s? "
> -				      (if (and trash
> -					       delete-by-moving-to-trash)
> -					  "trash"
> -					"delete")
> -				      (dired-make-relative file)))))
> -	(if (eq recursive 'top) (setq recursive 'always)) ; Don't ask again.
> -      (setq recursive nil))
> -    (delete-directory file recursive trash)))
> +       ;; 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 trash)
> +         (let* ((valid-answers (list "y" "n" "!" "q"))

Shouldn't the valid-answers be "yes" and "no", not "y" and "n", for
backward compatibility?

> +                                  (completing-read (format "Recursively %s %s? [y, n, !, q] "

Maybe the "!" and "q" parts should be explained?  Or maybe just use
"yes", "no", "all", and "quite", which are self-explanatory?

This warrants a NEWS entry, I think.  I also wonder whether we should
describe this in the user manual, under "Dired Deletion".

Than ks.




This bug report was last modified 7 years and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.