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'.