I have (setq trash-directory "~/.Trash")
and (setq delete-by-moving-to-trash t)
in .emacs
to be able to have files moved to ~/.Trash
via d
and then x
in dired-mode
. (This is in macOS.)
But if I want to delete a file (= move to the trash) that already exists in ~/.Trash, then I get error file-already-exists: File already exists: /Users/<myuser>/.Trash/<myfile>
.
How can I specify in .emacs
to (force-)overwrite files in ~/.Trash if they already exist in ~/.Trash?
Alternatively, how can I get Dired d
-then-x
to create a ~1
, ~2
etc. version in Trash, every time a new file of the same base-name is moved there?
GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-09-02
. I also tried it without(setq trash-directory "~/.Trash")
. I can then indeed delete a file, but I don't see it in ~/.Trash (so also not overwriting one that's already in ~/.Trash). I perhaps simply removes the file then or uses some other trash I'm not aware of.~/.local/share/Trash/files
instead of~/.Trash
. So just the wrong folder so to say (but then changing that withtrash-directory
creates the original problememacs -Q