]> code.delx.au - gnu-emacs/commitdiff
Add the option to not create lockfiles
authorDave Abrahams <dave@boostpro.com>
Thu, 10 May 2012 00:55:57 +0000 (20:55 -0400)
committerGlenn Morris <rgm@gnu.org>
Thu, 10 May 2012 00:55:57 +0000 (20:55 -0400)
* src/filelock.c (syms_of_filelock): New boolean create-lockfiles.
(lock_file): If create_lockfiles is 0, do nothing.

* lisp/cus-start.el (create-lockfiles): Add it.

Fixes: debbugs:11227
lisp/ChangeLog
lisp/cus-start.el
src/ChangeLog
src/filelock.c

index bf15cd2f9aad90ff9051bc125a86b8d51082df8c..f1429f9f875b49c3c9faa9e36ca1620e1b389227 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-10  Dave Abrahams  <dave@boostpro.com>
+
+       * cus-start.el (create-lockfiles): Add it.
+
 2012-05-09  Chong Yidong  <cyd@gnu.org>
 
        * net/browse-url.el (browse-url-url-encode-chars): Use upper-case.
index 3863e718f586444c640263a45095a5a3b0b7b9a1..fc3c6561a1e9318a664eb3c49abe8a5d263f1165 100644 (file)
@@ -204,6 +204,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             (delete-by-moving-to-trash auto-save boolean "23.1")
             (auto-save-visited-file-name auto-save boolean)
             ;; filelock.c
+            (create-lockfiles files boolean "24.2")
             (temporary-file-directory
              ;; Darwin section added 24.1, does not seem worth :version bump.
              files directory nil
index 07d85cbf5c88bf951537062c94d8af3b06937551..d4e38f5271ca7b2b29cda94ac444b9a2b3944d29 100644 (file)
@@ -1,3 +1,8 @@
+2012-05-10  Dave Abrahams  <dave@boostpro.com>
+
+       * filelock.c (syms_of_filelock): New boolean create-lockfiles.
+       (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
+
 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
 
        * dbusbind.c (xd_registered_buses): New internal Lisp object.
index 2613eec4aca44917c3abda08d57ffb0496680f4c..d8914c733287148e3dbb0e53bbe6265d3c79178d 100644 (file)
@@ -550,6 +550,10 @@ lock_file (Lisp_Object fn)
   struct gcpro gcpro1;
   USE_SAFE_ALLOCA;
 
+  /* Don't do locking if the user has opted out.  */
+  if (! create_lockfiles)
+    return;
+
   /* Don't do locking while dumping Emacs.
      Uncompressing wtmp files uses call-process, which does not work
      in an uninitialized Emacs.  */
@@ -722,6 +726,10 @@ syms_of_filelock (void)
               doc: /* The directory for writing temporary files.  */);
   Vtemporary_file_directory = Qnil;
 
+  DEFVAR_BOOL ("create-lockfiles", create_lockfiles,
+              doc: /* Non-nil means use lockfiles to avoid editing collisions.  */);
+  create_lockfiles = 1;
+
 #ifdef CLASH_DETECTION
   defsubr (&Sunlock_buffer);
   defsubr (&Slock_buffer);