From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27940: Recursively delete dir34? (yes, no, all, quit) Date: Fri, 04 Aug 2017 15:46:28 +0300 Message-ID: <834ltnxzyz.fsf@gnu.org> References: <87o9rwxmfz.fsf@jidanni.org> <87r2wrkacy.fsf@calancha-pc> <83a83fybrc.fsf@gnu.org> <87vam365q2.fsf@calancha-pc> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1501855836 1932 195.159.176.226 (4 Aug 2017 14:10:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 4 Aug 2017 14:10:36 +0000 (UTC) Cc: 27940@debbugs.gnu.org, jidanni@jidanni.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 04 16:10:30 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dddJ6-0008HA-JR for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Aug 2017 16:10:28 +0200 Original-Received: from localhost ([::1]:54128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddJ7-0003ex-Gm for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Aug 2017 10:10:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddcS5-0000Sw-5S for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 09:17:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddc6A-0005M0-1O for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 08:54:39 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38325) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddc69-0005Ln-T1 for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 08:53:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ddc69-00086z-L3 for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2017 08:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Aug 2017 12:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27940 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27940-submit@debbugs.gnu.org id=B27940.150185115931151 (code B ref 27940); Fri, 04 Aug 2017 12:53:01 +0000 Original-Received: (at 27940) by debbugs.gnu.org; 4 Aug 2017 12:52:39 +0000 Original-Received: from localhost ([127.0.0.1]:41002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddc5m-00086M-RE for submit@debbugs.gnu.org; Fri, 04 Aug 2017 08:52:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41139) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddc5l-00086B-Oc for 27940@debbugs.gnu.org; Fri, 04 Aug 2017 08:52:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddc4c-0002G7-NR for 27940@debbugs.gnu.org; Fri, 04 Aug 2017 08:52:32 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddc01-0002nY-LB; Fri, 04 Aug 2017 08:46:41 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4490 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ddc00-0005H2-Pw; Fri, 04 Aug 2017 08:46:41 -0400 In-reply-to: <87vam365q2.fsf@calancha-pc> (message from Tino Calancha on Fri, 04 Aug 2017 18:29:41 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135339 Archived-At: > From: Tino Calancha > Cc: 27940@debbugs.gnu.org, jidanni@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.