Subject: bug#47960: 28.0.50; delete-by-moving-to-trash fails on directories?

From: Gregory Heytings <[email-masked]>
Date: Thu, 22 Apr 2021 21:11:19 +0000

>
> On trunk the (setq delete-by-moving-to-trash t) no longer works in Dired 
> and Eshell when trying to delete a directory.
>
> Steps to reproduce with emacs -Q:
>
> + Evaluate (setq delete-by-moving-to-trash t).
> + Use 'C-x C-j' to jump to a dired buffer.
> + Then type '+' and create a new directory named "test" or whatever.
> + With point over the newly created directory ,type "D", and confirm.
>
> You get an error: "file-error: Renaming: Not a directory [...]"
>
> Same if you try to delete the directory with the 'rm -r' command from 
> inside eshell (though 'rmdir' works in this case).
>
> For completeness, M-x shell works with either 'rm -r' and 'rmdir'.
>

Are you sure this bug is not due to something going wrong on your machine? 
I'm unable to reproduce this bug here, both Dired and Eshell seem to work 
as expected.

Did you by any chance define a 'system-move-file-to-trash' function?

Does it work when you (setq trash-directory <something>)?