* category.h (CHAR_HAS_CATEGORY): Define as inline.
[bpt/emacs.git] / src / filelock.c
index 5ee2c03..d8914c7 100644 (file)
@@ -1,5 +1,5 @@
 /* Lock files for editing.
-   Copyright (C) 1985-1987, 1993-1994, 1996, 1998-2011
+   Copyright (C) 1985-1987, 1993-1994, 1996, 1998-2012
                  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -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);