summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-02-25 19:36:03 +0200
committerEli Zaretskii <eliz@gnu.org>2013-02-25 19:36:03 +0200
commit343a2aefb528ce3c978ba2145705b9e37bfbe02a (patch)
tree4672030eea98dfc9bd077ac58400271d1c812918 /doc
parentaec32f66d0db82b562e904dfe7bb6d54796fe773 (diff)
downloademacs-343a2aefb528ce3c978ba2145705b9e37bfbe02a.tar.gz
Implement CLASH_DETECTION for MS-Windows.
src/filelock.c [WINDOWSNT]: Include w32.h. (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime function of that name. Up-case the macro arguments. (IS_LOCK_FILE): New macro. (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK. (create_lock_file): New function, with body extracted from lock_file_1. [WINDOWSNT]: Implement lock files by writing a regular file with the lock information as its contents. (read_lock_data): New function, on Posix platforms just calls emacs_readlinkat. [WINDOWSNT]: Read the lock info from the file. (current_lock_owner): Call read_lock_data instead of calling emacs_readlinkat directly. (lock_file) [WINDOWSNT]: Run the file name through dostounix_filename. src/w32proc.c (sys_kill): Support the case of SIG = 0, in which case just check if the process by that PID exists. src/w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is also present, as doing so will fail to error out if the file already exists. src/makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h. nt/inc/ms-w32.h (BOOT_TIME_FILE): Define. nt/config.nt (CLASH_DETECTION): Define to 1. lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Reject files that match "\`\.#", to avoid compiling lock files, even if they are readable (as they are on MS-Windows). doc/emacs/files.texi (Interlocking): Don't refer to symlinks as the exclusive means of locking files. etc/NEWS: Mention support for lock files on MS-Windows.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/files.texi24
2 files changed, 17 insertions, 12 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 33f530cbadc..44245441791 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-25 Eli Zaretskii <eliz@gnu.org>
+
+ * files.texi (Interlocking): Don't refer to symlinks as the
+ exclusive means of locking files.
+
2013-02-22 Glenn Morris <rgm@gnu.org>
* ack.texi (Acknowledgments):
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 7f7ae483cd5..1f78747eaa6 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -734,10 +734,10 @@ file.
@cindex locking files
When you make the first modification in an Emacs buffer that is
visiting a file, Emacs records that the file is @dfn{locked} by you.
-(It does this by creating a specially-named symbolic link in the same
-directory.) Emacs removes the lock when you save the changes. The
-idea is that the file is locked whenever an Emacs buffer visiting it
-has unsaved changes.
+(It does this by creating a specially-named symbolic link or regular
+file with special contents in the same directory.) Emacs removes the
+lock when you save the changes. The idea is that the file is locked
+whenever an Emacs buffer visiting it has unsaved changes.
@vindex create-lockfiles
You can prevent the creation of lock files by setting the variable
@@ -774,14 +774,14 @@ multiple names, Emacs does not prevent two users from editing it
simultaneously under different names.
A lock file cannot be written in some circumstances, e.g., if Emacs
-lacks the system permissions or the system does not support symbolic
-links. In these cases, Emacs can still detect the collision when you
-try to save a file, by checking the file's last-modification date. If
-the file has changed since the last time Emacs visited or saved it,
-that implies that changes have been made in some other way, and will
-be lost if Emacs proceeds with saving. Emacs then displays a warning
-message and asks for confirmation before saving; answer @kbd{yes} to
-save, and @kbd{no} or @kbd{C-g} cancel the save.
+lacks the system permissions or cannot create lock files for some
+other reason. In these cases, Emacs can still detect the collision
+when you try to save a file, by checking the file's last-modification
+date. If the file has changed since the last time Emacs visited or
+saved it, that implies that changes have been made in some other way,
+and will be lost if Emacs proceeds with saving. Emacs then displays a
+warning message and asks for confirmation before saving; answer
+@kbd{yes} to save, and @kbd{no} or @kbd{C-g} cancel the save.
If you are notified that simultaneous editing has already taken
place, one way to compare the buffer to its file is the @kbd{M-x