2

I'm new to Emacs and org-mode. Whenever I make changes to any org file it creates auto-save files. For example if the file I'm editing is tasks.org, it creates these files : #tasks.org#, .#tasks.org# and tasks.org~. I want to disable this behaviour.

PS: I'm using Emacs on Windows

1

2 Answers 2

0
  1. To not create backup files (*~), customize option make-backup-files.

  2. To not create auto-save files (#...#), turn off auto-save-mode in your init file:

(auto-save-mode -1)

But do so at your peril. Better to search this site for tag [auto-save], to see other possibilities. Better yet: read the Emacs manual about auto-save files.

However, if you only want to disable auto-save for Org files, then this question should be deleted as a duplicate of this one. In that case, please delete your question.

2
  • Does this disable backups ending with ~ as well? Or (setq make-backup-files nil) needed?
    – Arktik
    Commented Mar 16, 2023 at 21:21
  • The original question includes disabling saving files ending with ~, which are backup files. You should add that to your answer.
    – Arktik
    Commented Mar 16, 2023 at 21:26
0

Just put these files to a separate directory (for example, to ~/.emacs-saves/). To do this, add to your ~/.emacs file:

(setq auto-save-file-name-transforms '((".*" "~/.emacs-saves/" t)))
(setq lock-file-name-transforms '((".*" "~/.emacs-saves/" t)))
(setq backup-directory-alist '((".*" . "~/.emacs-saves/")))

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.