4

I've currently got:

(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

in my .emacs, but that doesn't seem to have changed where auto-save files get saved (it has changed where backup files get saved. M-x describe-variable shows that temporary-file-directory is set to /tmp/, but when I edit a file called testing.md and have unsaved changes, I get a file called .#testing.md in the same directory. How can I make that file go somewhere else (e.g. /tmp/)?

I've had no luck with these suggestions, so any suggestions welcome!

If it helps, I'm on GNU Emacs 23.3.1, running Ubuntu.

2 Answers 2

10

These files are not autosaves, they're lock files. Try to ls -l them, and you'll see that they're symbolic links that point to bogus filenames which are actually the username+pid of the editing process. AFAIK, there's no way to customize that. (The whole point is to avoid problems when two different users edit the same file -- if one changes the lockfile location they won't know about each other's edits.) See also this question.

(BTW, using /tmp to save backups is really not a good idea unless you're sure that you're the only user on the machine.)

2
; auto save path
(defvar autosave-dir (concat "~/auto-save" "/"))
(make-directory autosave-dir t)
(setq auto-save-file-name-transforms
      `(("\\(?:[^/]*/\\)*\\(.*\\)" ,(concat autosave-dir "\\1") t)))

OS : win7 Ver: emacs 23.4

You must log in to answer this question.

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