comparison man/lispref/backups.texi @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents 8e84bee8ddd0
children 1ccc32a20af4
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
1 @c -*-texinfo-*- 1 @c -*-texinfo-*-
2 @c This is part of the XEmacs Lisp Reference Manual. 2 @c This is part of the XEmacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
4 @c See the file lispref.texi for copying conditions. 4 @c See the file lispref.texi for copying conditions.
5 @setfilename ../../info/backups.info 5 @setfilename ../../info/backups.info
6 @node Backups and Auto-Saving, Buffers, Files, Top 6 @node Backups and Auto-Saving, Buffers, Files, Top
7 @chapter Backups and Auto-Saving 7 @chapter Backups and Auto-Saving
8 8
76 which may save disk space. (You would put this code in your 76 which may save disk space. (You would put this code in your
77 @file{.emacs} file.) 77 @file{.emacs} file.)
78 78
79 @smallexample 79 @smallexample
80 @group 80 @group
81 (add-hook 'rmail-mode-hook 81 (add-hook 'rmail-mode-hook
82 (function (lambda () 82 (function (lambda ()
83 (make-local-variable 83 (make-local-variable
84 'make-backup-files) 84 'make-backup-files)
85 (setq make-backup-files nil)))) 85 (setq make-backup-files nil))))
86 @end group 86 @end group
87 @end smallexample 87 @end smallexample
88 @end defopt 88 @end defopt
119 119
120 @node Rename or Copy 120 @node Rename or Copy
121 @subsection Backup by Renaming or by Copying? 121 @subsection Backup by Renaming or by Copying?
122 @cindex backup files, how to make them 122 @cindex backup files, how to make them
123 123
124 There are two ways that XEmacs can make a backup file: 124 There are two ways that XEmacs can make a backup file:
125 125
126 @itemize @bullet 126 @itemize @bullet
127 @item 127 @item
128 XEmacs can rename the original file so that it becomes a backup file, and 128 XEmacs can rename the original file so that it becomes a backup file, and
129 then write the buffer being saved into a new file. After this 129 then write the buffer being saved into a new file. After this
345 This function returns the name of the most recent backup file for 345 This function returns the name of the most recent backup file for
346 @var{filename}, or @code{nil} if that file has no backup files. 346 @var{filename}, or @code{nil} if that file has no backup files.
347 347
348 Some file comparison commands use this function so that they can 348 Some file comparison commands use this function so that they can
349 automatically compare a file with its most recent backup. 349 automatically compare a file with its most recent backup.
350 @end defun 350 @end defun
351 351
352 @node Auto-Saving 352 @node Auto-Saving
353 @section Auto-Saving 353 @section Auto-Saving
354 @cindex auto-saving 354 @cindex auto-saving
355 355
419 change the naming convention for auto-save files. If you redefine it, 419 change the naming convention for auto-save files. If you redefine it,
420 be sure to redefine the function @code{make-auto-save-file-name} 420 be sure to redefine the function @code{make-auto-save-file-name}
421 correspondingly. 421 correspondingly.
422 @end defun 422 @end defun
423 423
424 @defun make-auto-save-file-name 424 @defun make-auto-save-file-name &optional filename
425 This function returns the file name to use for auto-saving the current 425 This function returns the file name to use for auto-saving the current
426 buffer. This is just the file name with hash marks (@samp{#}) appended 426 buffer. This is just the file name with hash marks (@samp{#}) appended
427 and prepended to it. This function does not look at the variable 427 and prepended to it. This function does not look at the variable
428 @code{auto-save-visited-file-name} (described below); you should check 428 @code{auto-save-visited-file-name} (described below); you should check
429 that before calling this function. 429 that before calling this function.
579 If you have made extensive changes to a file and then change your mind 579 If you have made extensive changes to a file and then change your mind
580 about them, you can get rid of them by reading in the previous version 580 about them, you can get rid of them by reading in the previous version
581 of the file with the @code{revert-buffer} command. @xref{Reverting, , 581 of the file with the @code{revert-buffer} command. @xref{Reverting, ,
582 Reverting a Buffer, emacs, The XEmacs Reference Manual}. 582 Reverting a Buffer, emacs, The XEmacs Reference Manual}.
583 583
584 @deffn Command revert-buffer &optional check-auto-save noconfirm 584 @deffn Command revert-buffer &optional check-auto-save noconfirm preserve-modes
585 This command replaces the buffer text with the text of the visited 585 This command replaces the buffer text with the text of the visited
586 file on disk. This action undoes all changes since the file was visited 586 file on disk. This action undoes all changes since the file was visited
587 or saved. 587 or saved.
588 588
589 If the argument @var{check-auto-save} is non-@code{nil}, and the 589 If the argument @var{check-auto-save} is non-@code{nil}, and the
594 argument. 594 argument.
595 595
596 Normally, @code{revert-buffer} asks for confirmation before it changes 596 Normally, @code{revert-buffer} asks for confirmation before it changes
597 the buffer; but if the argument @var{noconfirm} is non-@code{nil}, 597 the buffer; but if the argument @var{noconfirm} is non-@code{nil},
598 @code{revert-buffer} does not ask for confirmation. 598 @code{revert-buffer} does not ask for confirmation.
599
600 Optional third argument @var{preserve-modes} non-@code{nil} means don't
601 alter the files modes. Normally we reinitialize them using
602 @code{normal-mode}.
599 603
600 Reverting tries to preserve marker positions in the buffer by using the 604 Reverting tries to preserve marker positions in the buffer by using the
601 replacement feature of @code{insert-file-contents}. If the buffer 605 replacement feature of @code{insert-file-contents}. If the buffer
602 contents and the file contents are identical before the revert 606 contents and the file contents are identical before the revert
603 operation, reverting preserves all the markers. If they are not 607 operation, reverting preserves all the markers. If they are not