# HG changeset patch # User Chong Yidong # Date 1152115502 0 # Node ID 5cdc253a3479e39f59843c7ffe704f1047a99a83 # Parent c97bd29593d661a26d31cbb00963793c2fe96314 * insdel.c (prepare_to_modify_buffer): For an indirect buffer, do clash detection using the base buffer. diff -r c97bd29593d6 -r 5cdc253a3479 src/ChangeLog --- a/src/ChangeLog Wed Jul 05 15:12:41 2006 +0000 +++ b/src/ChangeLog Wed Jul 05 16:05:02 2006 +0000 @@ -1,5 +1,8 @@ 2006-07-05 Chong Yidong + * insdel.c (prepare_to_modify_buffer): For an indirect buffer, do + clash detection using the base buffer. + * puresize.h (BASE_PURESIZE): Increment to 1210500. 2006-07-04 Kim F. Storm diff -r c97bd29593d6 -r 5cdc253a3479 src/insdel.c --- a/src/insdel.c Wed Jul 05 15:12:41 2006 +0000 +++ b/src/insdel.c Wed Jul 05 16:05:02 2006 +0000 @@ -2031,6 +2031,8 @@ 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 @@ 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);