I have this in my .init.el file:

(setq backup-directory-alist
      `((".*" . "~/.saves")))
(setq auto-save-file-name-transforms
      `((".*" "~/.saves" t)))

Yet I am still getting random backup files in both the working directory and my home directory.

How can I fix this? Is there another setting I'm missing?

  • 1
    Try not have ~ in the path, instead use the full path. (I don't know if this is needed, but I have it in my init file, there must have been a reason for it.) Also, make sure the auto-save directory exists. Dec 8, 2015 at 20:17
  • Thanks, I tried, but they are still being created. The .save directory is there and I changed it to the full user path. Dec 9, 2015 at 7:34
  • The documentation for backup-directory-alist says "On MS-DOS filesystems without long names this variable is always ignored." Do you use an Emacs that is compiled as an MS-DOS application?
    – pst
    Dec 10, 2015 at 15:27

1 Answer 1


Try without the star in backup-directory-alist and add slash at the end of directory name

 (setq backup-directory-alist
        '(("." . "~/.saves/"))) ;; remove the star
 (setq auto-save-file-name-transforms
        `((".*" ,"~/.saves/" t)))
  • Ahhhh, never mind still happening. Is it weird that they are appearing in the $HOME directory? Dec 12, 2015 at 1:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.