diff options
| author | Kenichi Handa | 2012-08-22 18:05:50 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-08-22 18:05:50 +0900 |
| commit | fabc1281e9cde34ff9a19d843316d2ceca8647ad (patch) | |
| tree | f38f13cab3ec6c32ab8ab49ea2e60f64969a0d22 /src/undo.c | |
| parent | 4ff819d728960bf5e52b72501c606f4bb3fde028 (diff) | |
| parent | 842e3a93aa3a0826cb4148376e54cd1527d10901 (diff) | |
| download | emacs-fabc1281e9cde34ff9a19d843316d2ceca8647ad.tar.gz emacs-fabc1281e9cde34ff9a19d843316d2ceca8647ad.zip | |
merge trunk
Diffstat (limited to 'src/undo.c')
| -rw-r--r-- | src/undo.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/undo.c b/src/undo.c index cfb67ba5bc8..777e3291806 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -104,9 +104,9 @@ record_point (ptrdiff_t pt) | |||
| 104 | if (at_boundary | 104 | if (at_boundary |
| 105 | && current_buffer == last_boundary_buffer | 105 | && current_buffer == last_boundary_buffer |
| 106 | && last_boundary_position != pt) | 106 | && last_boundary_position != pt) |
| 107 | BSET (current_buffer, undo_list, | 107 | bset_undo_list (current_buffer, |
| 108 | Fcons (make_number (last_boundary_position), | 108 | Fcons (make_number (last_boundary_position), |
| 109 | BVAR (current_buffer, undo_list))); | 109 | BVAR (current_buffer, undo_list))); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | /* Record an insertion that just happened or is about to happen, | 112 | /* Record an insertion that just happened or is about to happen, |
| @@ -142,8 +142,8 @@ record_insert (ptrdiff_t beg, ptrdiff_t length) | |||
| 142 | 142 | ||
| 143 | XSETFASTINT (lbeg, beg); | 143 | XSETFASTINT (lbeg, beg); |
| 144 | XSETINT (lend, beg + length); | 144 | XSETINT (lend, beg + length); |
| 145 | BSET (current_buffer, undo_list, | 145 | bset_undo_list (current_buffer, |
| 146 | Fcons (Fcons (lbeg, lend), BVAR (current_buffer, undo_list))); | 146 | Fcons (Fcons (lbeg, lend), BVAR (current_buffer, undo_list))); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | /* Record that a deletion is about to take place, | 149 | /* Record that a deletion is about to take place, |
| @@ -168,8 +168,9 @@ record_delete (ptrdiff_t beg, Lisp_Object string) | |||
| 168 | record_point (beg); | 168 | record_point (beg); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | BSET (current_buffer, undo_list, | 171 | bset_undo_list |
| 172 | Fcons (Fcons (string, sbeg), BVAR (current_buffer, undo_list))); | 172 | (current_buffer, |
| 173 | Fcons (Fcons (string, sbeg), BVAR (current_buffer, undo_list))); | ||
| 173 | } | 174 | } |
| 174 | 175 | ||
| 175 | /* Record the fact that MARKER is about to be adjusted by ADJUSTMENT. | 176 | /* Record the fact that MARKER is about to be adjusted by ADJUSTMENT. |
| @@ -191,9 +192,10 @@ record_marker_adjustment (Lisp_Object marker, ptrdiff_t adjustment) | |||
| 191 | Fundo_boundary (); | 192 | Fundo_boundary (); |
| 192 | last_undo_buffer = current_buffer; | 193 | last_undo_buffer = current_buffer; |
| 193 | 194 | ||
| 194 | BSET (current_buffer, undo_list, | 195 | bset_undo_list |
| 195 | Fcons (Fcons (marker, make_number (adjustment)), | 196 | (current_buffer, |
| 196 | BVAR (current_buffer, undo_list))); | 197 | Fcons (Fcons (marker, make_number (adjustment)), |
| 198 | BVAR (current_buffer, undo_list))); | ||
| 197 | } | 199 | } |
| 198 | 200 | ||
| 199 | /* Record that a replacement is about to take place, | 201 | /* Record that a replacement is about to take place, |
| @@ -226,9 +228,10 @@ record_first_change (void) | |||
| 226 | if (base_buffer->base_buffer) | 228 | if (base_buffer->base_buffer) |
| 227 | base_buffer = base_buffer->base_buffer; | 229 | base_buffer = base_buffer->base_buffer; |
| 228 | 230 | ||
| 229 | BSET (current_buffer, undo_list, | 231 | bset_undo_list |
| 230 | Fcons (Fcons (Qt, make_lisp_time (base_buffer->modtime)), | 232 | (current_buffer, |
| 231 | BVAR (current_buffer, undo_list))); | 233 | Fcons (Fcons (Qt, make_lisp_time (base_buffer->modtime)), |
| 234 | BVAR (current_buffer, undo_list))); | ||
| 232 | } | 235 | } |
| 233 | 236 | ||
| 234 | /* Record a change in property PROP (whose old value was VAL) | 237 | /* Record a change in property PROP (whose old value was VAL) |
| @@ -266,8 +269,8 @@ record_property_change (ptrdiff_t beg, ptrdiff_t length, | |||
| 266 | XSETINT (lbeg, beg); | 269 | XSETINT (lbeg, beg); |
| 267 | XSETINT (lend, beg + length); | 270 | XSETINT (lend, beg + length); |
| 268 | entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend)))); | 271 | entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend)))); |
| 269 | BSET (current_buffer, undo_list, | 272 | bset_undo_list (current_buffer, |
| 270 | Fcons (entry, BVAR (current_buffer, undo_list))); | 273 | Fcons (entry, BVAR (current_buffer, undo_list))); |
| 271 | 274 | ||
| 272 | current_buffer = obuf; | 275 | current_buffer = obuf; |
| 273 | } | 276 | } |
| @@ -290,11 +293,12 @@ but another undo command will undo to the previous boundary. */) | |||
| 290 | /* If we have preallocated the cons cell to use here, | 293 | /* If we have preallocated the cons cell to use here, |
| 291 | use that one. */ | 294 | use that one. */ |
| 292 | XSETCDR (pending_boundary, BVAR (current_buffer, undo_list)); | 295 | XSETCDR (pending_boundary, BVAR (current_buffer, undo_list)); |
| 293 | BSET (current_buffer, undo_list, pending_boundary); | 296 | bset_undo_list (current_buffer, pending_boundary); |
| 294 | pending_boundary = Qnil; | 297 | pending_boundary = Qnil; |
| 295 | } | 298 | } |
| 296 | else | 299 | else |
| 297 | BSET (current_buffer, undo_list, Fcons (Qnil, BVAR (current_buffer, undo_list))); | 300 | bset_undo_list (current_buffer, |
| 301 | Fcons (Qnil, BVAR (current_buffer, undo_list))); | ||
| 298 | } | 302 | } |
| 299 | last_boundary_position = PT; | 303 | last_boundary_position = PT; |
| 300 | last_boundary_buffer = current_buffer; | 304 | last_boundary_buffer = current_buffer; |
| @@ -435,7 +439,7 @@ truncate_undo_list (struct buffer *b) | |||
| 435 | XSETCDR (last_boundary, Qnil); | 439 | XSETCDR (last_boundary, Qnil); |
| 436 | /* There's nothing we decided to keep, so clear it out. */ | 440 | /* There's nothing we decided to keep, so clear it out. */ |
| 437 | else | 441 | else |
| 438 | BSET (b, undo_list, Qnil); | 442 | bset_undo_list (b, Qnil); |
| 439 | 443 | ||
| 440 | unbind_to (count, Qnil); | 444 | unbind_to (count, Qnil); |
| 441 | } | 445 | } |
| @@ -650,8 +654,9 @@ Return what remains of the list. */) | |||
| 650 | will work right. */ | 654 | will work right. */ |
| 651 | if (did_apply | 655 | if (did_apply |
| 652 | && EQ (oldlist, BVAR (current_buffer, undo_list))) | 656 | && EQ (oldlist, BVAR (current_buffer, undo_list))) |
| 653 | BSET (current_buffer, undo_list, | 657 | bset_undo_list |
| 654 | Fcons (list3 (Qapply, Qcdr, Qnil), BVAR (current_buffer, undo_list))); | 658 | (current_buffer, |
| 659 | Fcons (list3 (Qapply, Qcdr, Qnil), BVAR (current_buffer, undo_list))); | ||
| 655 | 660 | ||
| 656 | UNGCPRO; | 661 | UNGCPRO; |
| 657 | return unbind_to (count, list); | 662 | return unbind_to (count, list); |