summaryrefslogtreecommitdiff
path: root/devdocs/elisp/numbered-backups.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/numbered-backups.html')
-rw-r--r--devdocs/elisp/numbered-backups.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/devdocs/elisp/numbered-backups.html b/devdocs/elisp/numbered-backups.html
new file mode 100644
index 00000000..cc124454
--- /dev/null
+++ b/devdocs/elisp/numbered-backups.html
@@ -0,0 +1,19 @@
+ <h4 class="subsection">Making and Deleting Numbered Backup Files</h4> <p>If a file’s name is <samp>foo</samp>, the names of its numbered backup versions are <samp>foo.~<var>v</var>~</samp>, for various integers <var>v</var>, like this: <samp>foo.~1~</samp>, <samp>foo.~2~</samp>, <samp>foo.~3~</samp>, …, <samp>foo.~259~</samp>, and so on. </p> <dl> <dt id="version-control">User Option: <strong>version-control</strong>
+</dt> <dd>
+<p>This variable controls whether to make a single non-numbered backup file or multiple numbered backups. </p> <dl compact> <dt><code>nil</code></dt> <dd>
+<p>Make numbered backups if the visited file already has numbered backups; otherwise, do not. This is the default. </p> </dd> <dt><code>never</code></dt> <dd>
+<p>Do not make numbered backups. </p> </dd> <dt><var>anything else</var></dt> <dd><p>Make numbered backups. </p></dd> </dl> </dd>
+</dl> <p>The use of numbered backups ultimately leads to a large number of backup versions, which must then be deleted. Emacs can do this automatically or it can ask the user whether to delete them. </p> <dl> <dt id="kept-new-versions">User Option: <strong>kept-new-versions</strong>
+</dt> <dd><p>The value of this variable is the number of newest versions to keep when a new numbered backup is made. The newly made backup is included in the count. The default value is 2. </p></dd>
+</dl> <dl> <dt id="kept-old-versions">User Option: <strong>kept-old-versions</strong>
+</dt> <dd><p>The value of this variable is the number of oldest versions to keep when a new numbered backup is made. The default value is 2. </p></dd>
+</dl> <p>If there are backups numbered 1, 2, 3, 5, and 7, and both of these variables have the value 2, then the backups numbered 1 and 2 are kept as old versions and those numbered 5 and 7 are kept as new versions; backup version 3 is excess. The function <code>find-backup-file-name</code> (see <a href="backup-names">Backup Names</a>) is responsible for determining which backup versions to delete, but does not delete them itself. </p> <dl> <dt id="delete-old-versions">User Option: <strong>delete-old-versions</strong>
+</dt> <dd><p>If this variable is <code>t</code>, then saving a file deletes excess backup versions silently. If it is <code>nil</code>, that means to ask for confirmation before deleting excess backups. Otherwise, they are not deleted at all. </p></dd>
+</dl> <dl> <dt id="dired-kept-versions">User Option: <strong>dired-kept-versions</strong>
+</dt> <dd><p>This variable specifies how many of the newest backup versions to keep in the Dired command <kbd>.</kbd> (<code>dired-clean-directory</code>). That’s the same thing <code>kept-new-versions</code> specifies when you make a new backup file. The default is 2. </p></dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Numbered-Backups.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Numbered-Backups.html</a>
+ </p>
+</div>