aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-09-15 12:47:10 +0000
committerRichard M. Stallman2005-09-15 12:47:10 +0000
commit81a3597738afebfddc5be09ed744abfad7b42cba (patch)
treef01514e994e45456779e70621f6d728bfe747add
parent3af0867d70af94e7bfca777c259f05ec3aa41219 (diff)
downloademacs-81a3597738afebfddc5be09ed744abfad7b42cba.tar.gz
emacs-81a3597738afebfddc5be09ed744abfad7b42cba.zip
(Saving Commands): New node, broken out of Saving.
(Customize Save): New node, broken out of Saving. Clarify effect of write-region-inhibit-fsync. (Misc File Ops): Say write-region-inhibit-fsync affects write-region.
-rw-r--r--man/files.texi89
1 files changed, 51 insertions, 38 deletions
diff --git a/man/files.texi b/man/files.texi
index b8e8d60c2f9..cd8360bf8f9 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -366,6 +366,21 @@ variables defined for that file (@pxref{File Variables}).
366 @dfn{Saving} a buffer in Emacs means writing its contents back into the file 366 @dfn{Saving} a buffer in Emacs means writing its contents back into the file
367that was visited in the buffer. 367that was visited in the buffer.
368 368
369@menu
370* Save Commands:: Commands for saving files.
371* Backup:: How Emacs saves the old version of your file.
372* Customize Save:: Customizing the saving of files.
373* Interlocking:: How Emacs protects against simultaneous editing
374 of one file by two users.
375* Shadowing: File Shadowing. Copying files to "shadows" automatically.
376* Time Stamps:: Emacs can update time stamps on saved files.
377@end menu
378
379@node Saving Commands
380@subsection Commands for Saving Files
381
382 These are the commands that relate to saving and writing files.
383
369@table @kbd 384@table @kbd
370@item C-x C-s 385@item C-x C-s
371Save the current buffer in its visited file on disk (@code{save-buffer}). 386Save the current buffer in its visited file on disk (@code{save-buffer}).
@@ -483,42 +498,6 @@ notifies you of this fact, because it probably indicates a problem caused
483by simultaneous editing and requires your immediate attention. 498by simultaneous editing and requires your immediate attention.
484@xref{Interlocking,, Simultaneous Editing}. 499@xref{Interlocking,, Simultaneous Editing}.
485 500
486@vindex require-final-newline
487 If the value of the variable @code{require-final-newline} is
488@code{t}, Emacs silently puts a newline at the end of any file that
489doesn't already end in one, every time a file is saved or written. If
490the value is @code{visit}, Emacs adds a newline at the end of any file
491that doesn't have one, just after it visits the file. (This marks the
492buffer as modified, and you can undo it.) If the value is
493@code{visit-save}, that means to add newlines both on visiting and on
494saving. If the value is @code{nil}, Emacs leaves the end of the file
495unchanged; if it's neither @code{nil} nor @code{t}, Emacs asks you
496whether to add a newline. The default is @code{nil}.
497
498@vindex mode-require-final-newline
499 Many major modes are designed for specific kinds of files that are
500always supposed to end in newlines. These major modes set the
501variable @code{require-final-newline} according to
502@code{mode-require-final-newline}. By setting the latter variable,
503you can control how these modes handle final newlines.
504
505@vindex write-region-inhibit-fsync
506 When Emacs saves a file to disk, it issues an @code{fsync} call to the
507operating system to ensure that your data has indeed reached the media.
508This is important for safety if the system crashes or in case of power
509outage. However, it can be disruptive on laptops using power saving
510because it forces the system to spin up the drive each time you save a
511file; the variable @code{write-region-inhibit-fsync} disables this
512synchronization. This may result in data loss, use with care!
513
514@menu
515* Backup:: How Emacs saves the old version of your file.
516* Interlocking:: How Emacs protects against simultaneous editing
517 of one file by two users.
518* Shadowing: File Shadowing. Copying files to "shadows" automatically.
519* Time Stamps:: Emacs can update time stamps on saved files.
520@end menu
521
522@node Backup 501@node Backup
523@subsection Backup Files 502@subsection Backup Files
524@cindex backup file 503@cindex backup file
@@ -725,6 +704,38 @@ typically break hard links, disconnecting the file name you visited from
725any alternate names for the same file. This has nothing to do with 704any alternate names for the same file. This has nothing to do with
726Emacs---the version control system does it. 705Emacs---the version control system does it.
727 706
707@node Customize Save
708@subsection Customizing Saving of Files
709
710@vindex require-final-newline
711 If the value of the variable @code{require-final-newline} is
712@code{t}, saving or writing a file silently puts a newline at the end
713if there isn't already one there. If the value is @code{visit}, Emacs
714adds a newline at the end of any file that doesn't have one, just
715after it visits the file. (This marks the buffer as modified, and you
716can undo it.) If the value is @code{visit-save}, that means to add
717newlines both on visiting and on saving. If the value is @code{nil},
718Emacs leaves the end of the file unchanged; if it's neither @code{nil}
719nor @code{t}, Emacs asks you whether to add a newline. The default is
720@code{nil}.
721
722@vindex mode-require-final-newline
723 Many major modes are designed for specific kinds of files that are
724always supposed to end in newlines. These major modes set the
725variable @code{require-final-newline} according to
726@code{mode-require-final-newline}. By setting the latter variable,
727you can control how these modes handle final newlines.
728
729@vindex write-region-inhibit-fsync
730 When Emacs saves a file, it invokes the @code{fsync} system call to
731force the data immediately out to disk. This is important for safety
732if the system crashes or in case of power outage. However, it can be
733disruptive on laptops using power saving, because it requires the disk
734to spin up each time you save a file. Setting
735@code{write-region-inhibit-fsync} to a non-@code{nil} value disables
736this synchronization. Be careful---this means increased risk of data
737loss.
738
728@node Interlocking 739@node Interlocking
729@subsection Protection against Simultaneous Editing 740@subsection Protection against Simultaneous Editing
730 741
@@ -3008,8 +3019,10 @@ leaving point unchanged before the contents and the mark after them.
3008@findex write-region 3019@findex write-region
3009 @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it 3020 @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it
3010copies the contents of the region into the specified file. @kbd{M-x 3021copies the contents of the region into the specified file. @kbd{M-x
3011append-to-file} adds the text of the region to the end of the specified 3022append-to-file} adds the text of the region to the end of the
3012file. @xref{Accumulating Text}. 3023specified file. @xref{Accumulating Text}. The variable
3024@code{write-region-inhibit-fsync} applies to these commands, as well
3025as saving files; see @ref{Customize Save}.
3013 3026
3014@findex delete-file 3027@findex delete-file
3015@cindex deletion (of files) 3028@cindex deletion (of files)