/[emacs]/emacs/man/files.texi
ViewVC logotype

Diff of /emacs/man/files.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.116 by rfrancoise, Wed Sep 14 20:20:55 2005 UTC revision 1.117 by rms, Thu Sep 15 12:47:10 2005 UTC
# Line 366  variables defined for that file (@pxref{ Line 366  variables defined for that file (@pxref{
366    @dfn{Saving} a buffer in Emacs means writing its contents back into the file    @dfn{Saving} a buffer in Emacs means writing its contents back into the file
367  that was visited in the buffer.  that was visited in the buffer.
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    
384  @table @kbd  @table @kbd
385  @item C-x C-s  @item C-x C-s
386  Save the current buffer in its visited file on disk (@code{save-buffer}).  Save the current buffer in its visited file on disk (@code{save-buffer}).
# Line 483  notifies you of this fact, because it pr Line 498  notifies you of this fact, because it pr
498  by simultaneous editing and requires your immediate attention.  by simultaneous editing and requires your immediate attention.
499  @xref{Interlocking,, Simultaneous Editing}.  @xref{Interlocking,, Simultaneous Editing}.
500    
 @vindex require-final-newline  
   If the value of the variable @code{require-final-newline} is  
 @code{t}, Emacs silently puts a newline at the end of any file that  
 doesn't already end in one, every time a file is saved or written.  If  
 the value is @code{visit}, Emacs adds a newline at the end of any file  
 that doesn't have one, just after it visits the file.  (This marks the  
 buffer as modified, and you can undo it.)  If the value is  
 @code{visit-save}, that means to add newlines both on visiting and on  
 saving.  If the value is @code{nil}, Emacs leaves the end of the file  
 unchanged; if it's neither @code{nil} nor @code{t}, Emacs asks you  
 whether to add a newline.  The default is @code{nil}.  
   
 @vindex mode-require-final-newline  
   Many major modes are designed for specific kinds of files that are  
 always supposed to end in newlines.  These major modes set the  
 variable @code{require-final-newline} according to  
 @code{mode-require-final-newline}.  By setting the latter variable,  
 you can control how these modes handle final newlines.  
   
 @vindex write-region-inhibit-fsync  
   When Emacs saves a file to disk, it issues an @code{fsync} call to the  
 operating system to ensure that your data has indeed reached the media.  
 This is important for safety if the system crashes or in case of power  
 outage.  However, it can be disruptive on laptops using power saving  
 because it forces the system to spin up the drive each time you save a  
 file; the variable @code{write-region-inhibit-fsync} disables this  
 synchronization.  This may result in data loss, use with care!  
   
 @menu  
 * Backup::              How Emacs saves the old version of your file.  
 * Interlocking::        How Emacs protects against simultaneous editing  
                           of one file by two users.  
 * Shadowing: File Shadowing.  Copying files to "shadows" automatically.  
 * Time Stamps::         Emacs can update time stamps on saved files.  
 @end menu  
   
501  @node Backup  @node Backup
502  @subsection Backup Files  @subsection Backup Files
503  @cindex backup file  @cindex backup file
# Line 725  typically break hard links, disconnectin Line 704  typically break hard links, disconnectin
704  any alternate names for the same file.  This has nothing to do with  any alternate names for the same file.  This has nothing to do with
705  Emacs---the version control system does it.  Emacs---the version control system does it.
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
713    if there isn't already one there.  If the value is @code{visit}, Emacs
714    adds a newline at the end of any file that doesn't have one, just
715    after it visits the file.  (This marks the buffer as modified, and you
716    can undo it.)  If the value is @code{visit-save}, that means to add
717    newlines both on visiting and on saving.  If the value is @code{nil},
718    Emacs leaves the end of the file unchanged; if it's neither @code{nil}
719    nor @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
724    always supposed to end in newlines.  These major modes set the
725    variable @code{require-final-newline} according to
726    @code{mode-require-final-newline}.  By setting the latter variable,
727    you 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
731    force the data immediately out to disk.  This is important for safety
732    if the system crashes or in case of power outage.  However, it can be
733    disruptive on laptops using power saving, because it requires the disk
734    to spin up each time you save a file.  Setting
735    @code{write-region-inhibit-fsync} to a non-@code{nil} value disables
736    this synchronization.  Be careful---this means increased risk of data
737    loss.
738    
739  @node Interlocking  @node Interlocking
740  @subsection Protection against Simultaneous Editing  @subsection Protection against Simultaneous Editing
741    
# Line 3008  leaving point unchanged before the conte Line 3019  leaving point unchanged before the conte
3019  @findex write-region  @findex write-region
3020    @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it    @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it
3021  copies the contents of the region into the specified file.  @kbd{M-x  copies the contents of the region into the specified file.  @kbd{M-x
3022  append-to-file} adds the text of the region to the end of the specified  append-to-file} adds the text of the region to the end of the
3023  file.  @xref{Accumulating Text}.  specified file.  @xref{Accumulating Text}.  The variable
3024    @code{write-region-inhibit-fsync} applies to these commands, as well
3025    as saving files; see @ref{Customize Save}.
3026    
3027  @findex delete-file  @findex delete-file
3028  @cindex deletion (of files)  @cindex deletion (of files)

Legend:
Removed from v.1.116  
changed lines
  Added in v.1.117

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26