Subject: bug#27940: Recursively delete dir34? (yes, no, all, quit)

From: Tino Calancha <[email-masked]>
Date: Mon, 16 Oct 2017 14:20:03 +0900

Noam Postavsky <[email-masked]> writes:

> Tino Calancha <[email-masked]> writes:
>
>> I believe commit da4438e14f1c55808937872b6d651a807404daa2
>> (dired-delete-file:  Dont't ask for empty dirs)
>> has fixed it.
>
> The "no" case of dired-test-bug27940 is failing now.  I guess if
> RECURSIVE is set to nil, we should not try to delete non-empty
> directories, or maybe just catch the error if it happens?
Those tests implicitely assume you keep the
'dired-recursive-deletes' default, i.e. 'top; IMO it's not
sorprising that they fail if you run them interactively
with other 'dired-recursive-deletes' value.

We could explicitely set 'dired-recursive-deletes' 'top if you
prefer that.

The following snippet behaves the same in Emacs-25 and the master branch:

emacs -Q /tmp -eval "(customize-set-variable 'dired-recursive-deletes nil)"
+ foo RET RET
+ a/b RET
+ c/d RET
+ e RET
t D yes RET no RET no RET ; Only 'e' is deleted

;; Delete just 'c'
U D yes RET ; Signal an error
;; Probably this error should be catched as well?
;; We could open a bug report against 25.3 for this.