I have the following line in my .emacs to keep auto-saved files in a specific directory:

(setq backup-directory-alist (quote ((".*" . "C:/temp/emacsbackup"))))

And it works, I see the file, say "c:/myworkingdirectory/the_current_working_file", in that C:/temp/emacsbackup as "!drive_c!myworkingdirectory!the_current_working_file".

However, whenever I change the content in the_current_working_file, before I save it, I also see this two files in the working directory c:/myworkingdirectory/:


When I save the file the_current_working_file, these two backup disappear.

How do I prevent emacs from creating these two backups in the current working directory?

  • 1
    Say C-h i g (emacs) Auto Save and read the whole section. In particular, when disaster strikes, you might be thankful to have those files. BTW, auto-save and backup are different things.
    – NickD
    Jun 24 at 1:49
  • 1
    What @NickD said. As a start, you seem to be confusing backup files with auto-save files.
    – Drew
    Jun 24 at 2:01
  • I didn't mean to disable auto-save, I just want the auto-save files to be in a different directory other than the directory I am working on. Is that possible? I cannot find anything for it with M-x apropos auto-save.
    – tony
    Jun 26 at 5:09

This site is temporarily in read only mode and not accepting new answers.

Browse other questions tagged .