I want emacs to store all my backup files in the directory ~/.save.

I put the following code into my init.el file:

(setq backup-directory-alist `(("." . "~/.saves")))

However, this change does not take effect. The backup files are still generated in the directory where the original edited files are stored.

What am I doing wrong?

  • 1
    The doc says that the directory name can be absolute or relative. But it doesn't say it can make use of ~. You might try this: `(("." . ,(expand-file-name "~/.saves"))), to expand it to an absolute file name (or just use the absolute file name directly).
    – Drew
    Oct 29, 2016 at 17:28
  • @Drew Unfortunately both didn't work.
    – LaPriWa
    Oct 30, 2016 at 7:51
  • 1
    Perhaps it depends on when you set the variable in your init file. Have you checked, using C-h v, that after Emacs startup and initialization the variable has the value you think you set?
    – Drew
    Oct 30, 2016 at 16:36

1 Answer 1


The single quote is not the good one or/and you need to add a slash at end:

(setq backup-directory-alist '(("." . "~/.saves/")))

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .