changeset 16317:763b3b143ed6

(Vuser_login_name): Declared extern. (minibuf_level): extern decl moved to top level. (Fwrite_region): Query before writing to a file that is locked, even if it is locked by the same user.
author Richard M. Stallman <rms@gnu.org>
date Wed, 25 Sep 1996 03:23:03 +0000
parents 50be5f6cb5e6
children 86f1da650461
files src/fileio.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Tue Sep 24 23:54:08 1996 +0000
+++ b/src/fileio.c	Wed Sep 25 03:23:03 1996 +0000
@@ -183,6 +183,10 @@
    expanding file names.  This can be bound to / or \. */
 Lisp_Object Vdirectory_sep_char;
 
+extern Lisp_Object Vuser_login_name;
+
+extern int minibuf_level;
+
 /* These variables describe handlers that have "already" had a chance
    to handle the current operation.
 
@@ -3515,7 +3519,14 @@
 
 #ifdef CLASH_DETECTION
   if (!auto_saving)
-    lock_file (lockname);
+    {
+      /* If we've locked this file for some other buffer,
+	 query before proceeding.  */
+      if (!visiting && EQ (Ffile_locked_p (lockname), Qt))
+	call2 (intern ("ask-user-about-lock"), fn, Vuser_login_name);
+
+      lock_file (lockname);
+    }
 #endif /* CLASH_DETECTION */
 
   fn = XSTRING (filename)->data;
@@ -4064,7 +4075,6 @@
   int auto_saved = 0;
   char *omessage = echo_area_glyphs;
   int omessage_length = echo_area_glyphs_length;
-  extern int minibuf_level;
   int do_handled_files;
   Lisp_Object oquit;
   int listdesc;