summaryrefslogtreecommitdiff
path: root/doc/lispref/files.texi
diff options
context:
space:
mode:
authorRobert Pluim <rpluim@gmail.com>2018-06-01 15:05:23 +0200
committerRobert Pluim <rpluim@gmail.com>2018-06-01 15:06:20 +0200
commit9188291f7a3a2536ef0b694e4c75f3094cf46fcf (patch)
treeade6c263ba1cf79c32b12c738953ff7a4eb2b75d /doc/lispref/files.texi
parente5471b2381e885d5d214bfa09ab0c35275fc6048 (diff)
downloademacs-9188291f7a3a2536ef0b694e4c75f3094cf46fcf.tar.gz
emacs-9188291f7a3a2536ef0b694e4c75f3094cf46fcf.tar.bz2
emacs-9188291f7a3a2536ef0b694e4c75f3094cf46fcf.zip
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.
Diffstat (limited to 'doc/lispref/files.texi')
-rw-r--r--doc/lispref/files.texi14
1 files changed, 12 insertions, 2 deletions
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.