emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 21f2247 2/2: Merge branch 'emacs-26' of git.savan


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 21f2247 2/2: Merge branch 'emacs-26' of git.savannah.gnu.org:/srv/git/emacs into emacs-26
Date: Fri, 1 Jun 2018 10:11:24 -0400 (EDT)

branch: emacs-26
commit 21f2247cf49d2332dd3f6d696318c9c65fd26c83
Merge: 6d23525 3257085
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Merge branch 'emacs-26' of git.savannah.gnu.org:/srv/git/emacs into emacs-26
---
 doc/emacs/files.texi   |  9 ++++++---
 doc/lispref/files.texi | 14 ++++++++++++--
 src/filelock.c         |  5 ++++-
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 1ced7ca..821d8c1 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -766,13 +766,16 @@ file.
 
 @findex ask-user-about-lock
 @cindex locking files
address@hidden .#, lock file names
address@hidden file locking
   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 address@hidden
 your file system does not support symbolic links, a regular file is
-used.} 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.
+used.} with special contents in the same directory.  @xref{File
+Locks,,, elisp} for more details.)  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
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 5137f3a..6dfca0f 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
address@hidden .#, 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
address@hidden@var{user}@@@address@hidden:@var{boot}}, where @var{user}
+is replaced with the current username (from @code{user-login-name}),
address@hidden with the name of the host where Emacs is running (from
address@hidden), @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 @address@hidden@@@address@hidden:@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.
diff --git a/src/filelock.c b/src/filelock.c
index f2dc723..d33063c 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -849,7 +849,10 @@ syms_of_filelock (void)
   Vtemporary_file_directory = Qnil;
 
   DEFVAR_BOOL ("create-lockfiles", create_lockfiles,
-              doc: /* Non-nil means use lockfiles to avoid editing collisions. 
 */);
+              doc: /* Non-nil means use lockfiles to avoid editing collisions.
+The name of the (per-buffer) lockfile is constructed by prepending a
+'.#' to the name of the file being locked.  See also `lock-buffer' and
+Info node `(emacs)Interlocking'.  */);
   create_lockfiles = 1;
 
   defsubr (&Sunlock_buffer);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]