diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-09-25 03:23:03 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-09-25 03:23:03 +0000 |
commit | 59033c7d5c5dbcf61545ee25dfa06f0f3725a1c8 (patch) | |
tree | e3cce1df81aa81bba2c488b4b322bc6b8bbf58d7 /src/fileio.c | |
parent | e5cdeb1baa08142c70c9d5fef52e8115856205ca (diff) | |
download | emacs-59033c7d5c5dbcf61545ee25dfa06f0f3725a1c8.tar.gz |
(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.
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c index ab1ec670c87..bd7adb56da2 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -183,6 +183,10 @@ int vms_stmlf_recfm; 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 @@ to the file, instead of any buffer contents, and END is ignored.") #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 @@ A non-nil CURRENT-ONLY argument means save only current buffer.") 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; |