Next: Configuring File Name Completion, Previous: Init File, Up: Configuring [Index]
When configured, Emacs saves the old contents of a file you are working on in a backup file before saving the contents of the newly-changed buffer into the file, but only for the first save of the buffer. If you kill the buffer and then visit the file again, a new backup fill will be made upon a new save. However, this behavior can be overridden manually by adding different numbers of ‘C-u’ ‘s when saving.
make-backup-filesVariable that determines whether to make backup files. It’s default value is ‘t’.
backup-directory-alistVariable that determines where backups should be saved based upon regexps. Emacs creates the directories when necessary. No files are overwritten because of name clashes.
("." . DIR)make all backups in the directory DIR.
("." . ".")~make backups in the invisible subdirectory ‘.~’ of the original file’s directory.
save-bufferSave current buffer in visited file if modified.
These are the possible variations that affect when backups are created::
save the buffer in its associated file.
mark the file to be backed up on the next save.
save the buffer and make a backup file immediately.
Do both of the above.
Never make the previous version into a backup file.
version-controlVariable that determines whether numbered backup files are produced. It can be set globally as well as locally for individual buffers. This variable can also be set according to an environment variable called ‘VERSION_CONTROL’.
origin value; make numeric backup versions for files that already have some; otherwise not.
never make numeric backup versions.
make numeric backup versions unconditionally.
Emacs can save a certain number of old file backups and a certain number of new file backups, deleting the ones in between, using the following two variables:
kept-old-versionsVariable that determines how many oldest versions to keep (default = 2).
kept-new-versionsVariable that determines how many newest versions to keep (default = 2).
delete-old-versionsVariable that determines whether backups will be deleted silently or only upon confirmation.
Emacs queries whether to delete excess backup versions (default);
Emacs deletes excess backup files silently.
(period) command can be used to delete old versions.
make-backup-file-name-functionHolds an elisp procedure to override the usual way Emacs constructs backup file names.
Next: Configuring File Name Completion, Previous: Init File, Up: Configuring [Index]