Hi.
Still learning Emacs but happy with it so far. One thing i’m trying to find out is this. I’m OK with Emacs creating recovery files from which i can, well, recover my work after emacs is closed. However, if I save my files, I have no need for these #filename# or filename~ files that populate my folders. Is there a way to make emacs keep creating these recovery files, but deleting them if I *save* my actual files?
First, for making sure the autosave files—the ones prefixed and suffixed by “#”—are cleaned up, ensure that
delete-auto-save-files
is non-nil (the default) and, if using Emacs 28 or later, setkill-buffer-delete-auto-save-files
to non-nil (that would normally bet
). As for the backup files ending in “~”, those are created on saving a modified file by default and their creation is disabled by settingmake-backup-files
to a non-nil value.All of this can be achieved, assuming you’re using Emacs 28 or later, by adding
to your init file.