summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-07-05 16:05:02 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-07-05 16:05:02 +0000
commit8b26f5ed18e9aa5c38ebb40171d4c8ce5eac9866 (patch)
tree23f4575664a124bec685c80c8039dc1bc5a3af43 /src/insdel.c
parent6f229b943bae804117d0eb029a63eb4c24e90adb (diff)
downloademacs-8b26f5ed18e9aa5c38ebb40171d4c8ce5eac9866.tar.gz
* insdel.c (prepare_to_modify_buffer): For an indirect buffer, do
clash detection using the base buffer.
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/insdel.c b/src/insdel.c
index b9d9574788e..b97539c1cc2 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2031,6 +2031,8 @@ prepare_to_modify_buffer (start, end, preserve_ptr)
int start, end;
int *preserve_ptr;
{
+ struct buffer *base_buffer;
+
if (!NILP (current_buffer->read_only))
Fbarf_if_buffer_read_only ();
@@ -2056,20 +2058,26 @@ prepare_to_modify_buffer (start, end, preserve_ptr)
verify_interval_modification (current_buffer, start, end);
}
+ /* For indirect buffers, use the base buffer to check clashes. */
+ if (current_buffer->base_buffer != 0)
+ base_buffer = current_buffer->base_buffer;
+ else
+ base_buffer = current_buffer;
+
#ifdef CLASH_DETECTION
- if (!NILP (current_buffer->file_truename)
+ if (!NILP (base_buffer->file_truename)
/* Make binding buffer-file-name to nil effective. */
- && !NILP (current_buffer->filename)
+ && !NILP (base_buffer->filename)
&& SAVE_MODIFF >= MODIFF)
- lock_file (current_buffer->file_truename);
+ lock_file (base_buffer->file_truename);
#else
/* At least warn if this file has changed on disk since it was visited. */
- if (!NILP (current_buffer->filename)
+ if (!NILP (base_buffer->filename)
&& SAVE_MODIFF >= MODIFF
&& NILP (Fverify_visited_file_modtime (Fcurrent_buffer ()))
- && !NILP (Ffile_exists_p (current_buffer->filename)))
+ && !NILP (Ffile_exists_p (base_buffer->filename)))
call1 (intern ("ask-user-about-supersession-threat"),
- current_buffer->filename);
+ base_buffer->filename);
#endif /* not CLASH_DETECTION */
signal_before_change (start, end, preserve_ptr);