How do I control when Emacs makes backup files?
I can't seems to find information开发者_如何学Python on when does Emacs makes backups. It generally works great, but today I've lost some part of a file because of Magit infamous revert shortcut and after looking at my backups directory don't find any of the files I've worked on today. Everything seems to be there for previous days tough.
Emacs backs up when you visit files, and auto-saves periodically when you edit - the manual (linked above) details things to change to make that process more aggressive. Unfortunately,
pressing v
in the status buffer for magit does not count as either visiting or editing the file, but note that a patch was commited to magit to ask for confirmation before reverting.
Generally speaking Emacs will save every single keystroke in backup files, by default named #foo#
if your file is named foo
. For more details, have a look at this AutoSave entry on the Emacs Wiki.
And/or search here for [emacs] backup
or [emacs] autosave
as this has been discussed before.
Emacs do not make backup of a file when a VCS take care of it It believe that the git/cvs/svn will take care of the backup mechanism.
Note also that magit 0.8 have been release with confirmation before reverting: you need to add
(setq magit-revert-item-confirm t)
in your .emacs to be protected.
精彩评论