Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 6 down vote accepted

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.)

share|improve this answer
add comment
; 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

share|improve this answer
add comment

Try advising make-auto-save-file-name to modify its return vale.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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