From 9188291f7a3a2536ef0b694e4c75f3094cf46fcf Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Fri, 1 Jun 2018 15:05:23 +0200 Subject: Add detailed documentation about lock files * doc/emacs/files.texi (Interlocking): Point user at detailed file locking description in lisp reference manual. Add index entry for '.#' to improve disoverability of information about locking. * doc/lispref/files.texi (File Locks): Describe in detail what the form of the lock file is. Add index entry for '.#' to improve disoverability of information about locking. * src/filelock.c (create-lockfiles): Add cross reference to file locking in user manual and to 'lock-buffer'. Add string '.#' to help users find the doc string. --- doc/lispref/files.texi | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'doc/lispref/files.texi') diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 5137f3a9ab4..6dfca0f2128 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -712,6 +712,7 @@ with-temp-buffer,, The Current Buffer}. @section File Locks @cindex file locks @cindex lock file +@cindex .#, lock file names When two users edit the same file at the same time, they are likely to interfere with each other. Emacs tries to prevent this situation @@ -720,8 +721,17 @@ modified. Emacs can then detect the first attempt to modify a buffer visiting a file that is locked by another Emacs job, and ask the user what to do. The file lock is really a file, a symbolic link with a special name, -stored in the same directory as the file you are editing. (On file -systems that do not support symbolic links, a regular file is used.) +stored in the same directory as the file you are editing. The name is +constructed by prepending @file{.#} to the filename of the buffer. +The target of the symbolic link will be of the form +@code{@var{user}@@@var{host}.@var{pid}:@var{boot}}, where @var{user} +is replaced with the current username (from @code{user-login-name}), +@var{host} with the name of the host where Emacs is running (from +@code{system-name}), @var{pid} with Emacs's process id, and @var{boot} +with the time since the last reboot. @code{:@var{boot}} is omitted if +the boot time is unavailable. (On file systems that do not support +symbolic links, a regular file is used instead, with contents of the +form @code{@var{user}@@@var{host}.@var{pid}:@var{boot}}.) When you access files using NFS, there may be a small probability that you and another user will both lock the same file simultaneously. -- cgit v1.2.1