How do I manage when Emacs creates backup files?

I can't seem to find information about when Emacs backs up. It usually works fine, but today I lost part of the file due to an incomprehensible callback to Magit and after looking at my backup directory I did not find any of the files that I worked on today. It seems that everything was hard in the previous days.

+4
source share
3 answers

Emacs creates backups when visiting files and automatically saves periodically when you edit - the manual (linked above) details everything that needs to be changed to make this process more aggressive. Unfortunately, pressing v in the status buffer for magit does not count as visiting or editing the file, but note that the patch has been fixed before magit to ask for confirmation before returning.

+3
source

Generally speaking, Emacs will save every keystroke in the backup files, by default with the name #foo# , if your file is named foo . See this AutoSave entry in the Emacs Wiki for more information.

And / or find here [emacs] backup or [emacs] autosave , as discussed earlier.

+1
source

Emacs does not back up the file when VCS takes care of this. He believes that git / cvs / svn will take care of the backup mechanism.

Please also note that magit 0.8 was released with a confirmation before return: you need to add

 (setq magit-revert-item-confirm t) 

in your .emacs for protection.

+1
source

Source: https://habr.com/ru/post/1335695/


All Articles