Next: Interlocking, Previous: Saving, Up: Saving [Contents][Index]
Because Unix does not provide version numbers in file names, rewriting a
file in Unix automatically destroys all record of what the file used to
contain. Thus, saving a file from Emacs throws away the old contents of
the file—or it would, except that Emacs carefully copies the old contents
to another file, called the backup file, before actually saving.
(Make sure that the variable make-backup-files
is non-nil
.
Backup files are not written if this variable is nil
).
At your option, Emacs can keep either a single backup file or a series of numbered backup files for each file you edit.
Emacs makes a backup for a file only the first time a file is saved from one buffer. No matter how many times you save a file, its backup file continues to contain the contents from before the file was visited. Normally this means that the backup file contains the contents from before the current editing session; however, if you kill the buffer and then visit the file again, a new backup file is made by the next save.
• Names: | How backup files are named; Choosing single or numbered backup files. | |
• Deletion: | Emacs deletes excess numbered backups. | |
• Copying: | Backups can be made by copying or renaming. |