I'm trying to make emacs' delete-file
function delete files with exclamation marks in their names.
The particular use case is that I have set emacs to save all backup files in a single directory and to delete old backup files. However, when all backup files are placed in one directory, the directory separator /
is replaced with !
. When delete-file is called on a file with an exclamation mark in its name, it returns zero and the file is not deleted. It doesn't signal any error. Normally, delete-file returns nil. Anyway, emacs' backup system uses delete-file for deletion, and I'd rather not redefine the entire function just to change a single line.
I've tried backslashing the exclamation marks and shell-quoting the filename string, and neither has worked.
So, how can I make this work?
Emacs version:
GNU Emacs 23.1.50.1
emacs-snapshot:
Installed: 1:20090730-1~jaunty1
EDIT: I found out that something in my config is causing this, but I havent figured out what yet.
EDIT 2: I have tracked the source of the problem to my custom system-move-file-to-trash
function, which I now have to debug.