diff options
| author | Chong Yidong | 2006-07-05 16:05:02 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-07-05 16:05:02 +0000 |
| commit | 234fb7734a5577ede16c6d40bac73e5fbe7bb33e (patch) | |
| tree | 55989ba671d4a6ebf5e71a08413f14b68d6b2828 | |
| parent | e2e6e4d2fa20a63755d1b88b54de8eee2008b941 (diff) | |
| download | emacs-234fb7734a5577ede16c6d40bac73e5fbe7bb33e.tar.gz emacs-234fb7734a5577ede16c6d40bac73e5fbe7bb33e.zip | |
* insdel.c (prepare_to_modify_buffer): For an indirect buffer, do
clash detection using the base buffer.
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/insdel.c | 20 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2a5e7afa99a..d91bee1cb1c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2006-07-05 Chong Yidong <cyd@stupidchicken.com> | 1 | 2006-07-05 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * insdel.c (prepare_to_modify_buffer): For an indirect buffer, do | ||
| 4 | clash detection using the base buffer. | ||
| 5 | |||
| 3 | * puresize.h (BASE_PURESIZE): Increment to 1210500. | 6 | * puresize.h (BASE_PURESIZE): Increment to 1210500. |
| 4 | 7 | ||
| 5 | 2006-07-04 Kim F. Storm <storm@cua.dk> | 8 | 2006-07-04 Kim F. Storm <storm@cua.dk> |
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) | |||
| 2031 | int start, end; | 2031 | int start, end; |
| 2032 | int *preserve_ptr; | 2032 | int *preserve_ptr; |
| 2033 | { | 2033 | { |
| 2034 | struct buffer *base_buffer; | ||
| 2035 | |||
| 2034 | if (!NILP (current_buffer->read_only)) | 2036 | if (!NILP (current_buffer->read_only)) |
| 2035 | Fbarf_if_buffer_read_only (); | 2037 | Fbarf_if_buffer_read_only (); |
| 2036 | 2038 | ||
| @@ -2056,20 +2058,26 @@ prepare_to_modify_buffer (start, end, preserve_ptr) | |||
| 2056 | verify_interval_modification (current_buffer, start, end); | 2058 | verify_interval_modification (current_buffer, start, end); |
| 2057 | } | 2059 | } |
| 2058 | 2060 | ||
| 2061 | /* For indirect buffers, use the base buffer to check clashes. */ | ||
| 2062 | if (current_buffer->base_buffer != 0) | ||
| 2063 | base_buffer = current_buffer->base_buffer; | ||
| 2064 | else | ||
| 2065 | base_buffer = current_buffer; | ||
| 2066 | |||
| 2059 | #ifdef CLASH_DETECTION | 2067 | #ifdef CLASH_DETECTION |
| 2060 | if (!NILP (current_buffer->file_truename) | 2068 | if (!NILP (base_buffer->file_truename) |
| 2061 | /* Make binding buffer-file-name to nil effective. */ | 2069 | /* Make binding buffer-file-name to nil effective. */ |
| 2062 | && !NILP (current_buffer->filename) | 2070 | && !NILP (base_buffer->filename) |
| 2063 | && SAVE_MODIFF >= MODIFF) | 2071 | && SAVE_MODIFF >= MODIFF) |
| 2064 | lock_file (current_buffer->file_truename); | 2072 | lock_file (base_buffer->file_truename); |
| 2065 | #else | 2073 | #else |
| 2066 | /* At least warn if this file has changed on disk since it was visited. */ | 2074 | /* At least warn if this file has changed on disk since it was visited. */ |
| 2067 | if (!NILP (current_buffer->filename) | 2075 | if (!NILP (base_buffer->filename) |
| 2068 | && SAVE_MODIFF >= MODIFF | 2076 | && SAVE_MODIFF >= MODIFF |
| 2069 | && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ())) | 2077 | && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ())) |
| 2070 | && !NILP (Ffile_exists_p (current_buffer->filename))) | 2078 | && !NILP (Ffile_exists_p (base_buffer->filename))) |
| 2071 | call1 (intern ("ask-user-about-supersession-threat"), | 2079 | call1 (intern ("ask-user-about-supersession-threat"), |
| 2072 | current_buffer->filename); | 2080 | base_buffer->filename); |
| 2073 | #endif /* not CLASH_DETECTION */ | 2081 | #endif /* not CLASH_DETECTION */ |
| 2074 | 2082 | ||
| 2075 | signal_before_change (start, end, preserve_ptr); | 2083 | signal_before_change (start, end, preserve_ptr); |