Add the option to not create lockfiles

* 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
This commit is contained in:
Dave Abrahams 2012-05-09 20:55:57 -04:00 committed by Glenn Morris
parent db5a300303
commit 836d29b370
4 changed files with 18 additions and 0 deletions

View 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.

View 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

View 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.

View 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);