I have placed my autosave and backup files in a single directory .emacs-saves.

Backup files appear as ~foo

Autosave files appear as #foo#

But Emacs seems to also generate .#foo in the current directory whenever a change is made in a buffer.

What's the purpose of these files and is there a way to specify their default directory?

1 Answer 1


These are lock files. See Save lock-files to a directory instead of disabling them

If you are accessing files remotely (think tramp or nfs) then it is a lot simpler to have the lock files in the same directory as the file being edited.


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.