0

I want my autosave files and backup files, e.g. #filename.org# and filename.org~ files, not to clutter the directory in my code repo that is in TypeScript.

I have popped into a way to place inside another directory and it worked. However, after that I have seen another file popping up with .#filename.org.

What is this file for? How can I make Emacs put them into another directory too?

Drew
  • 75,699
  • 9
  • 109
  • 225
sçuçu
  • 275
  • 1
  • 10
  • 1
    It's a lockfile to prevent another emacs from overwriting your changes. There's no provision for putting them somewhere else (but you can turn them off by setting `create-lockfiles` to `nil`) – rpluim Jan 14 '21 at 14:53
  • If teh file is saved the lock file is destroyed, that means in my specific case I actually do not need to have a way to make emacs create them in another dirctory. I did not want the emacs specific files to clutter my other editors direcotry view. Also one can add a gitignore file to ignore tracking those files, there are comprehensie ready made gitignore files for emacs and many things. – sçuçu Jan 14 '21 at 20:59

1 Answers1

1

emacs-28, which has just been released, comes with lock-file-name-transforms, which lets you place those lockfiles somewhere other than in the same directory.

rpluim
  • 4,605
  • 8
  • 22
  • If you are not accessing shared files, then turning off lock-files altogether is probably fine. If you /are/ accessing files shared with other emacs users, then the locks are only useful if everyone agrees on lock-file-name-transforms.... – glucas May 05 '22 at 15:24
  • There's also the case where the other Emacs user is yourself with another instance of Emacs. I run into that surprisingly often. – rpluim May 09 '22 at 13:49