diff options
| author | Richard M. Stallman | 1995-01-02 06:26:46 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-02 06:26:46 +0000 |
| commit | ad9cdce411a4fd164a754626d9286cc45be8a807 (patch) | |
| tree | 0cdb719024233409b66f16ce282be55a06caafd9 | |
| parent | 3fe8bda56f651afc2846cfac561dfff604cb846f (diff) | |
| download | emacs-ad9cdce411a4fd164a754626d9286cc45be8a807.tar.gz emacs-ad9cdce411a4fd164a754626d9286cc45be8a807.zip | |
(Fprimitive_undo): Use base buffer's modtime field.
Use SAVE_MODIFF and BUF_SAVE_MODIFF
instead of direct access to the save_modiff field.
| -rw-r--r-- | src/undo.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/undo.c b/src/undo.c index 9fdba2f1d8f..86c30c5d226 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -57,7 +57,7 @@ record_insert (beg, length) | |||
| 57 | Fundo_boundary (); | 57 | Fundo_boundary (); |
| 58 | XSETBUFFER (last_undo_buffer, current_buffer); | 58 | XSETBUFFER (last_undo_buffer, current_buffer); |
| 59 | 59 | ||
| 60 | if (MODIFF <= current_buffer->save_modified) | 60 | if (MODIFF <= SAVE_MODIFF) |
| 61 | record_first_change (); | 61 | record_first_change (); |
| 62 | 62 | ||
| 63 | /* If this is following another insertion and consecutive with it | 63 | /* If this is following another insertion and consecutive with it |
| @@ -105,7 +105,7 @@ record_delete (beg, length) | |||
| 105 | at_boundary = (CONSP (current_buffer->undo_list) | 105 | at_boundary = (CONSP (current_buffer->undo_list) |
| 106 | && NILP (XCONS (current_buffer->undo_list)->car)); | 106 | && NILP (XCONS (current_buffer->undo_list)->car)); |
| 107 | 107 | ||
| 108 | if (MODIFF <= current_buffer->save_modified) | 108 | if (MODIFF <= SAVE_MODIFF) |
| 109 | record_first_change (); | 109 | record_first_change (); |
| 110 | 110 | ||
| 111 | if (point == beg + length) | 111 | if (point == beg + length) |
| @@ -146,6 +146,7 @@ record_change (beg, length) | |||
| 146 | record_first_change () | 146 | record_first_change () |
| 147 | { | 147 | { |
| 148 | Lisp_Object high, low; | 148 | Lisp_Object high, low; |
| 149 | struct buffer *base_buffer = current_buffer; | ||
| 149 | 150 | ||
| 150 | if (EQ (current_buffer->undo_list, Qt)) | 151 | if (EQ (current_buffer->undo_list, Qt)) |
| 151 | return; | 152 | return; |
| @@ -154,8 +155,11 @@ record_first_change () | |||
| 154 | Fundo_boundary (); | 155 | Fundo_boundary (); |
| 155 | XSETBUFFER (last_undo_buffer, current_buffer); | 156 | XSETBUFFER (last_undo_buffer, current_buffer); |
| 156 | 157 | ||
| 157 | XSETFASTINT (high, (current_buffer->modtime >> 16) & 0xffff); | 158 | if (base_buffer->base_buffer) |
| 158 | XSETFASTINT (low, current_buffer->modtime & 0xffff); | 159 | base_buffer = base_buffer->base_buffer; |
| 160 | |||
| 161 | XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff); | ||
| 162 | XSETFASTINT (low, base_buffer->modtime & 0xffff); | ||
| 159 | current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list); | 163 | current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list); |
| 160 | } | 164 | } |
| 161 | 165 | ||
| @@ -187,7 +191,7 @@ record_property_change (beg, length, prop, value, buffer) | |||
| 187 | if (boundary) | 191 | if (boundary) |
| 188 | Fundo_boundary (); | 192 | Fundo_boundary (); |
| 189 | 193 | ||
| 190 | if (MODIFF <= current_buffer->save_modified) | 194 | if (MODIFF <= SAVE_MODIFF) |
| 191 | record_first_change (); | 195 | record_first_change (); |
| 192 | 196 | ||
| 193 | XSETINT (lbeg, beg); | 197 | XSETINT (lbeg, beg); |
| @@ -380,14 +384,19 @@ Return what remains of the list.") | |||
| 380 | /* Element (t high . low) records previous modtime. */ | 384 | /* Element (t high . low) records previous modtime. */ |
| 381 | Lisp_Object high, low; | 385 | Lisp_Object high, low; |
| 382 | int mod_time; | 386 | int mod_time; |
| 387 | struct buffer *base_buffer = current_buffer; | ||
| 383 | 388 | ||
| 384 | high = Fcar (cdr); | 389 | high = Fcar (cdr); |
| 385 | low = Fcdr (cdr); | 390 | low = Fcdr (cdr); |
| 386 | mod_time = (XFASTINT (high) << 16) + XFASTINT (low); | 391 | mod_time = (XFASTINT (high) << 16) + XFASTINT (low); |
| 392 | |||
| 393 | if (current_buffer->base_buffer) | ||
| 394 | base_buffer = current_buffer->base_buffer; | ||
| 395 | |||
| 387 | /* If this records an obsolete save | 396 | /* If this records an obsolete save |
| 388 | (not matching the actual disk file) | 397 | (not matching the actual disk file) |
| 389 | then don't mark unmodified. */ | 398 | then don't mark unmodified. */ |
| 390 | if (mod_time != current_buffer->modtime) | 399 | if (mod_time != base_buffer->modtime) |
| 391 | break; | 400 | break; |
| 392 | #ifdef CLASH_DETECTION | 401 | #ifdef CLASH_DETECTION |
| 393 | Funlock_buffer (); | 402 | Funlock_buffer (); |