aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2013-05-04 17:51:49 -0700
committerPaul Eggert2013-05-04 17:51:49 -0700
commitcbee2131718baa6389713bb551bcfd5c72b39035 (patch)
tree2f28d12ed0cac14194f0e9a56376b19ccad3c2b5 /doc
parentfd3a9a6b378e556c3b09b217920d95cb129a13d6 (diff)
downloademacs-cbee2131718baa6389713bb551bcfd5c72b39035.tar.gz
emacs-cbee2131718baa6389713bb551bcfd5c72b39035.zip
`write-region-inhibit-fsync' defaults to noninteractive.
* cmdargs.texi (Initial Options): * files.texi (Customize Save): Document this. * etc/NEWS: Document this. * src/fileio.c (syms_of_fileio): Implement this. * src/filelock.c (create_lock_file): If symbolic links don't work, so we use a regular file as a lock file, do not fsync the lock file; it's not needed. Fixes: debbugs:14273
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog6
-rw-r--r--doc/emacs/cmdargs.texi3
-rw-r--r--doc/emacs/files.texi28
3 files changed, 29 insertions, 8 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 2c47bdd4fad..348100c8408 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,9 @@
12013-05-05 Paul Eggert <eggert@cs.ucla.edu>
2
3 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
4 * cmdargs.texi (Initial Options):
5 * files.texi (Customize Save): Document this.
6
12013-05-04 Glenn Morris <rgm@gnu.org> 72013-05-04 Glenn Morris <rgm@gnu.org>
2 8
3 * calendar.texi (Importing Diary): Mention diary-from-outlook-function. 9 * calendar.texi (Importing Diary): Mention diary-from-outlook-function.
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 19b439afc7f..e285104b5de 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -251,7 +251,8 @@ terminal's standard input stream (@code{stdin}) instead.
251but @file{site-start.el} is loaded nonetheless. It also causes Emacs 251but @file{site-start.el} is loaded nonetheless. It also causes Emacs
252to exit after processing all the command options. In addition, it 252to exit after processing all the command options. In addition, it
253disables auto-saving except in buffers for which auto-saving is 253disables auto-saving except in buffers for which auto-saving is
254explicitly requested. 254explicitly requested, and when saving files it omits the @code{fsync}
255system call unless otherwise requested.
255 256
256@item --script @var{file} 257@item --script @var{file}
257@opindex --script 258@opindex --script
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 1f78747eaa6..13fa516af66 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -705,13 +705,27 @@ setting the latter variable, you can control how these modes handle
705final newlines. 705final newlines.
706 706
707@vindex write-region-inhibit-fsync 707@vindex write-region-inhibit-fsync
708 When Emacs saves a file, it invokes the @code{fsync} system call to 708 Normally, when a program writes a file, the operating system briefly
709force the data immediately out to disk. This is important for safety 709caches the file's data in main memory before committing the data to
710if the system crashes or in case of power outage. However, it can be 710disk. This can greatly improve performance; for example, when running
711disruptive on laptops using power saving, as it may force a disk 711on laptops, it can avoid a disk spin-up each time a file is written.
712spin-up each time you save a file. If you accept an increased risk of 712However, it risks data loss if the operating system crashes before
713data loss, you can set @code{write-region-inhibit-fsync} to a 713committing the cache to disk.
714non-@code{nil} value to disable the synchronization. 714
715 To lessen this risk, Emacs can invoke the @code{fsync} system call
716after saving a file. Using @code{fsync} does not eliminate the risk
717of data loss, partly because many systems do not implement
718@code{fsync} properly, and partly because Emacs's file-saving
719procedure typically relies also on directory updates that might not
720survive a crash even if @code{fsync} works properly.
721
722 The @code{write-region-inhibit-fsync} variable controls whether
723Emacs invokes @code{fsync} after saving a file. The variable's
724default value is @code{nil} when Emacs is interactive, and @code{t}
725when Emacs runs in batch mode.
726
727 Emacs never uses @code{fsync} when writing auto-save files, as these
728files might lose data anyway.
715 729
716@node Interlocking 730@node Interlocking
717@subsection Protection against Simultaneous Editing 731@subsection Protection against Simultaneous Editing