4

I have specified both backup directory and auto-save directory.

;; set auto-save intervals
(setq auto-save-interval 25)
(setq auto-save-include-big-deletions t)
; auto save path
(defvar autosave-dir (concat "C:/temp/emacsbackup/autosave/" "/"))
(make-directory autosave-dir t)
(setq auto-save-file-name-transforms
      `(("\\(?:[^/]*/\\)*\\(.*\\)" ,(concat autosave-dir "\\1") t)))
;; Save all backup file in this directory.
(setq backup-directory-alist (quote ((".*" . "C:/temp/emacsbackup"))))

They seem to be working because I do see files in them when I edit files. However, whenever I make a change in a file, let's call it thisfile.extension, in the directory of this file lives immediately there is an auto-saved file names .#thisfile.extension - it stays there until I save the file. Is there any way I can prevent emacs from doing this?

tony
  • 113
  • 8

1 Answers1

9

This is not a backup file but rather a lock file. The file is created so that if another emacs instance reads the file it will not be able to save without extra intervention asking the user if they really want to do that.

This is detailed in the emacs manual Protection against Simultaneous Editing

The lock file creation can be stopped by using the code

(setq create-lockfiles nil)
mmmmmm
  • 491
  • 1
  • 4
  • 19