comparison lispref/backups.texi @ 25751:467b88fab665

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Fri, 17 Sep 1999 06:59:04 +0000
parents f5e3b4ecd255
children 6a17c48b52ef
comparison
equal deleted inserted replaced
25750:f1968a807f56 25751:467b88fab665
177 This variable is significant only if @code{backup-by-copying} is 177 This variable is significant only if @code{backup-by-copying} is
178 @code{nil}, since copying is always used when that variable is 178 @code{nil}, since copying is always used when that variable is
179 non-@code{nil}. 179 non-@code{nil}.
180 @end defvar 180 @end defvar
181 181
182 @defvar backup-by-copying-when-privileged-mismatch
183 This variable, if non-@code{nil}, specifies the same behavior as
184 @code{backup-by-copying-when-mismatch}, but only for certain user-id
185 values: namely, those less than or equal to a certain number. You set
186 this variable to that number.
187
188 Thus, if you set @code{backup-by-copying-when-privileged-mismatch}
189 to 0, backup by copying is done for the superuser only,
190 when necessary to prevent a change in the owner of the file.
191
192 The default is 200.
193 @end defvar
194
182 @node Numbered Backups 195 @node Numbered Backups
183 @subsection Making and Deleting Numbered Backup Files 196 @subsection Making and Deleting Numbered Backup Files
184 197
185 If a file's name is @file{foo}, the names of its numbered backup 198 If a file's name is @file{foo}, the names of its numbered backup
186 versions are @file{foo.~@var{v}~}, for various integers @var{v}, like 199 versions are @file{foo.~@var{v}~}, for various integers @var{v}, like
391 integer. Otherwise, it turns auto-saving off. 404 integer. Otherwise, it turns auto-saving off.
392 @end deffn 405 @end deffn
393 406
394 @defun auto-save-file-name-p filename 407 @defun auto-save-file-name-p filename
395 This function returns a non-@code{nil} value if @var{filename} is a 408 This function returns a non-@code{nil} value if @var{filename} is a
396 string that could be the name of an auto-save file. It works based on 409 string that could be the name of an auto-save file. It assumes
397 knowledge of the naming convention for auto-save files: a name that 410 the usual naming convention for auto-save files: a name that
398 begins and ends with hash marks (@samp{#}) is a possible auto-save file 411 begins and ends with hash marks (@samp{#}) is a possible auto-save file
399 name. The argument @var{filename} should not contain a directory part. 412 name. The argument @var{filename} should not contain a directory part.
400 413
401 @example 414 @example
402 @group 415 @group
431 444
432 @defun make-auto-save-file-name 445 @defun make-auto-save-file-name
433 This function returns the file name to use for auto-saving the current 446 This function returns the file name to use for auto-saving the current
434 buffer. This is just the file name with hash marks (@samp{#}) prepended 447 buffer. This is just the file name with hash marks (@samp{#}) prepended
435 and appended to it. This function does not look at the variable 448 and appended to it. This function does not look at the variable
436 @code{auto-save-visited-file-name} (described below); you should check 449 @code{auto-save-visited-file-name} (described below); callers of this
437 that before calling this function. 450 function should check that variable first.
438 451
439 @example 452 @example
440 @group 453 @group
441 (make-auto-save-file-name) 454 (make-auto-save-file-name)
442 @result{} "/xcssun/users/rms/lewis/#backup.texi#" 455 @result{} "/xcssun/users/rms/lewis/#backup.texi#"
473 the files they are visiting. That is, the auto-save is done in the same 486 the files they are visiting. That is, the auto-save is done in the same
474 file that you are editing. Normally, this variable is @code{nil}, so 487 file that you are editing. Normally, this variable is @code{nil}, so
475 auto-save files have distinct names that are created by 488 auto-save files have distinct names that are created by
476 @code{make-auto-save-file-name}. 489 @code{make-auto-save-file-name}.
477 490
478 When you change the value of this variable, the value does not take 491 When you change the value of this variable, the new value does not take
479 effect until the next time auto-save mode is reenabled in any given 492 effect in an existing buffer until the next time auto-save mode is
480 buffer. If auto-save mode is already enabled, auto-saves continue to go 493 reenabled in it. If auto-save mode is already enabled, auto-saves
481 in the same file name until @code{auto-save-mode} is called again. 494 continue to go in the same file name until @code{auto-save-mode} is
495 called again.
482 @end defvar 496 @end defvar
483 497
484 @defun recent-auto-save-p 498 @defun recent-auto-save-p
485 This function returns @code{t} if the current buffer has been 499 This function returns @code{t} if the current buffer has been
486 auto-saved since the last time it was read in or saved. 500 auto-saved since the last time it was read in or saved.
491 not be auto-saved again until the buffer text is changed again. The 505 not be auto-saved again until the buffer text is changed again. The
492 function returns @code{nil}. 506 function returns @code{nil}.
493 @end defun 507 @end defun
494 508
495 @defopt auto-save-interval 509 @defopt auto-save-interval
496 The value of this variable is the number of characters that Emacs 510 The value of this variable specifies how often to do auto-saving, in
497 reads from the keyboard between auto-saves. Each time this many more 511 terms of number of input events. Each time this many additional input
498 characters are read, auto-saving is done for all buffers in which it is 512 events are read, Emacs does auto-saving for all buffers in which that is
499 enabled. 513 enabled.
500 @end defopt 514 @end defopt
501 515
502 @defopt auto-save-timeout 516 @defopt auto-save-timeout
503 The value of this variable is the number of seconds of idle time that 517 The value of this variable is the number of seconds of idle time that
504 should cause auto-saving. Each time the user pauses for this long, 518 should cause auto-saving. Each time the user pauses for this long,
505 Emacs auto-saves any buffers that need it. (Actually, the specified 519 Emacs does auto-saving for all buffers in which that is enabled.
506 timeout is multiplied by a factor depending on the size of the current 520 (Actually, the specified timeout is multiplied by a factor depending on
507 buffer.) 521 the size of the current buffer.)
508 @end defopt 522 @end defopt
509 523
510 @defvar auto-save-hook 524 @defvar auto-save-hook
511 This normal hook is run whenever an auto-save is about to happen. 525 This normal hook is run whenever an auto-save is about to happen.
512 @end defvar 526 @end defvar
550 nothing. 564 nothing.
551 @end defun 565 @end defun
552 566
553 @defvar buffer-saved-size 567 @defvar buffer-saved-size
554 The value of this buffer-local variable is the length of the current 568 The value of this buffer-local variable is the length of the current
555 buffer as of the last time it was read in, saved, or auto-saved. This is 569 buffer, when it was last read in, saved, or auto-saved. This is
556 used to detect a substantial decrease in size, and turn off auto-saving 570 used to detect a substantial decrease in size, and turn off auto-saving
557 in response. 571 in response.
558 572
559 If it is @minus{}1, that means auto-saving is temporarily shut off in this 573 If it is @minus{}1, that means auto-saving is temporarily shut off in
560 buffer due to a substantial deletion. Explicitly saving the buffer 574 this buffer due to a substantial decrease in size. Explicitly saving
561 stores a positive value in this variable, thus reenabling auto-saving. 575 the buffer stores a positive value in this variable, thus reenabling
562 Turning auto-save mode off or on also alters this variable. 576 auto-saving. Turning auto-save mode off or on also updates this
577 variable, so that the substantial decrease in size is forgotten.
563 @end defvar 578 @end defvar
564 579
565 @defvar auto-save-list-file-name 580 @defvar auto-save-list-file-name
566 This variable (if non-@code{nil}) specifies a file for recording the 581 This variable (if non-@code{nil}) specifies a file for recording the
567 names of all the auto-save files. Each time Emacs does auto-saving, it 582 names of all the auto-save files. Each time Emacs does auto-saving, it
568 writes two lines into this file for each buffer that has auto-saving 583 writes two lines into this file for each buffer that has auto-saving
569 enabled. The first line gives the name of the visited file (it's empty 584 enabled. The first line gives the name of the visited file (it's empty
570 if the buffer has none), and the second gives the name of the auto-save 585 if the buffer has none), and the second gives the name of the auto-save
571 file. 586 file.
572 587
573 If Emacs exits normally, it deletes this file. If Emacs crashes, you 588 When Emacs exits normally, it deletes this file; if Emacs crashes, you
574 can look in the file to find all the auto-save files that might contain 589 can look in the file to find all the auto-save files that might contain
575 work that was otherwise lost. The @code{recover-session} command uses 590 work that was otherwise lost. The @code{recover-session} command uses
576 these files. 591 this file to find them.
577 592
578 The default name for this file is in your home directory and starts with 593 The default name for this file specifies your home directory and starts
579 @samp{.saves-}. It also contains the Emacs process @sc{id} and the host 594 with @samp{.saves-}. It also contains the Emacs process @sc{id} and the
580 name. 595 host name.
581 @end defvar 596 @end defvar
582 597
583 @node Reverting 598 @node Reverting
584 @section Reverting 599 @section Reverting
585 600
592 This command replaces the buffer text with the text of the visited 607 This command replaces the buffer text with the text of the visited
593 file on disk. This action undoes all changes since the file was visited 608 file on disk. This action undoes all changes since the file was visited
594 or saved. 609 or saved.
595 610
596 By default, if the latest auto-save file is more recent than the visited 611 By default, if the latest auto-save file is more recent than the visited
597 file, @code{revert-buffer} asks the user whether to use that instead. 612 file, and the argument @var{ignore-auto} is non-@code{nil},
598 But if the argument @var{ignore-auto} is non-@code{nil}, then only the 613 @code{revert-buffer} asks the user whether to use that auto-save
599 the visited file itself is used. Interactively, @var{ignore-auto} is 614 instead. When you invoke this command interactively, @var{ignore-auto}
600 @code{t} unless there is a numeric prefix argument; thus, the 615 is @code{t} unless there is a numeric prefix argument; thus, the
601 interactive default is to check the auto-save file. 616 interactive default is to check the auto-save file.
602 617
603 Normally, @code{revert-buffer} asks for confirmation before it changes 618 Normally, @code{revert-buffer} asks for confirmation before it changes
604 the buffer; but if the argument @var{noconfirm} is non-@code{nil}, 619 the buffer; but if the argument @var{noconfirm} is non-@code{nil},
605 @code{revert-buffer} does not ask for confirmation. 620 @code{revert-buffer} does not ask for confirmation.
606 621
607 Reverting tries to preserve marker positions in the buffer by using the 622 Reverting tries to preserve marker positions in the buffer by using the
608 replacement feature of @code{insert-file-contents}. If the buffer 623 replacement feature of @code{insert-file-contents}. If the buffer
609 contents and the file contents are identical before the revert 624 contents and the file contents are identical before the revert
610 operation, reverting preserves all the markers. If they are not 625 operation, reverting preserves all the markers. If they are not
611 identical, reverting does change the buffer; then it preserves the 626 identical, reverting does change the buffer; in that case, it preserves
612 markers in the unchanged text (if any) at the beginning and end of the 627 the markers in the unchanged text (if any) at the beginning and end of
613 buffer. Preserving any additional markers would be problematical. 628 the buffer. Preserving any additional markers would be problematical.
614 @end deffn 629 @end deffn
615 630
616 You can customize how @code{revert-buffer} does its work by setting 631 You can customize how @code{revert-buffer} does its work by setting
617 these variables---typically, as buffer-local variables. 632 these variables---typically, as buffer-local variables.
618 633
619 @defvar revert-without-query 634 @defvar revert-without-query
620 This variable holds a list of files that should be reverted without 635 This variable holds a list of files that should be reverted without
621 query. The value is a list of regular expressions. If a file name 636 query. The value is a list of regular expressions. If the visited file
622 matches one of these regular expressions, then @code{revert-buffer} 637 name matches one of these regular expressions, and the file has changed
623 reverts the file without asking the user for confirmation, if the file 638 on disk but the buffer is not modified, then @code{revert-buffer}
624 has changed on disk and the buffer is not modified. 639 reverts the file without asking the user for confirmation.
625 @end defvar 640 @end defvar
626 641
627 @defvar revert-buffer-function 642 @defvar revert-buffer-function
628 The value of this variable is the function to use to revert this buffer. 643 The value of this variable is the function to use to revert this buffer.
629 If non-@code{nil}, it is called as a function with no arguments to do 644 If non-@code{nil}, it is called as a function with no arguments to do
635 fashion, give this variable a buffer-local value that is a function to 650 fashion, give this variable a buffer-local value that is a function to
636 regenerate the contents. 651 regenerate the contents.
637 @end defvar 652 @end defvar
638 653
639 @defvar revert-buffer-insert-file-contents-function 654 @defvar revert-buffer-insert-file-contents-function
640 The value of this variable, if non-@code{nil}, is the function to use to 655 The value of this variable, if non-@code{nil}, specifies the function to use to
641 insert the updated contents when reverting this buffer. The function 656 insert the updated contents when reverting this buffer. The function
642 receives two arguments: first the file name to use; second, @code{t} if 657 receives two arguments: first the file name to use; second, @code{t} if
643 the user has asked to read the auto-save file. 658 the user has asked to read the auto-save file.
644 @end defvar 659 @end defvar
645 660
646 @defvar before-revert-hook 661 @defvar before-revert-hook
647 This normal hook is run by @code{revert-buffer} before actually 662 This normal hook is run by @code{revert-buffer} before
648 inserting the modified contents---but only if 663 inserting the modified contents---but only if
649 @code{revert-buffer-function} is @code{nil}. 664 @code{revert-buffer-function} is @code{nil}.
650 @end defvar 665 @end defvar
651 666
652 @defvar after-revert-hook 667 @defvar after-revert-hook
653 This normal hook is run by @code{revert-buffer} after actually inserting 668 This normal hook is run by @code{revert-buffer} after inserting
654 the modified contents---but only if @code{revert-buffer-function} is 669 the modified contents---but only if @code{revert-buffer-function} is
655 @code{nil}. 670 @code{nil}.
656 @end defvar 671 @end defvar