There is a strange behavior of delete-directory function with enabled flag delete-by-removing-to-trash. It deletes files one by one instead of applying move-file-to-trash to the directory. As a result emacs deletes big directories slowly and there
are many files in the trash after deleting, so it is impossible to restore the directory.
Example:
Directory structure:
ddd/
ccc/
1.txt
There are three files in the trash after deleting ddd:
trash/
ddd/
ccc/
1.txt
instead of one:
trash/
ddd/
It is very slow, because emacs traverse directory recursively.
I can't restore deleted directory.
What i need is exactly the same behavior as of move-file-to-trash. But it should be transparent (i.e. 'D x' in dired mode). How to solve the problem? As a temporary solution i see the making advice function for `delete-directory'.