Mercurial > hg > xemacs-beta
comparison src/undo.c @ 185:3d6bfa290dbd r20-3b19
Import from CVS: tag r20-3b19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:55:28 +0200 |
parents | 85ec50267440 |
children | d44af0c54775 |
comparison
equal
deleted
inserted
replaced
184:bcd2674570bf | 185:3d6bfa290dbd |
---|---|
78 if (NILP (last_undo_buffer) || b != XBUFFER (last_undo_buffer)) | 78 if (NILP (last_undo_buffer) || b != XBUFFER (last_undo_buffer)) |
79 { | 79 { |
80 undo_boundary (b); | 80 undo_boundary (b); |
81 XSETBUFFER (last_undo_buffer, b); | 81 XSETBUFFER (last_undo_buffer, b); |
82 } | 82 } |
83 | 83 |
84 /* Allocate a cons cell to be the undo boundary after this command. */ | 84 /* Allocate a cons cell to be the undo boundary after this command. */ |
85 if (hack_pending_boundary && NILP (pending_boundary)) | 85 if (hack_pending_boundary && NILP (pending_boundary)) |
86 pending_boundary = Fcons (Qnil, Qnil); | 86 pending_boundary = Fcons (Qnil, Qnil); |
87 | 87 |
88 if (BUF_MODIFF (b) <= BUF_SAVE_MODIFF (b)) | 88 if (BUF_MODIFF (b) <= BUF_SAVE_MODIFF (b)) |
134 XCDR (elt) = make_int (beg + length); | 134 XCDR (elt) = make_int (beg + length); |
135 return; | 135 return; |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 b->undo_list = Fcons (Fcons (make_int (beg), | 139 b->undo_list = Fcons (Fcons (make_int (beg), |
140 make_int (beg + length)), | 140 make_int (beg + length)), |
141 b->undo_list); | 141 b->undo_list); |
142 } | 142 } |
143 | 143 |
144 /* Record that a deletion is about to take place, | 144 /* Record that a deletion is about to take place, |
170 if (BUF_PT (b) == beg + length) | 170 if (BUF_PT (b) == beg + length) |
171 sbeg = make_int (-beg); | 171 sbeg = make_int (-beg); |
172 else | 172 else |
173 sbeg = make_int (beg); | 173 sbeg = make_int (beg); |
174 | 174 |
175 /* If we are just after an undo boundary, and | 175 /* If we are just after an undo boundary, and |
176 point wasn't at start of deleted range, record where it was. */ | 176 point wasn't at start of deleted range, record where it was. */ |
177 if (at_boundary | 177 if (at_boundary |
178 && BUFFERP (last_point_position_buffer) | 178 && BUFFERP (last_point_position_buffer) |
179 && b == XBUFFER (last_point_position_buffer) | 179 && b == XBUFFER (last_point_position_buffer) |
180 && last_point_position != XINT (sbeg)) | 180 && last_point_position != XINT (sbeg)) |
446 else if (EXTENTP (car)) | 446 else if (EXTENTP (car)) |
447 { | 447 { |
448 /* Element (extent start end) means that EXTENT was | 448 /* Element (extent start end) means that EXTENT was |
449 detached, and we need to reattach it. */ | 449 detached, and we need to reattach it. */ |
450 Lisp_Object extent_obj, start, end; | 450 Lisp_Object extent_obj, start, end; |
451 | 451 |
452 extent_obj = car; | 452 extent_obj = car; |
453 start = Fcar (cdr); | 453 start = Fcar (cdr); |
454 end = Fcar (Fcdr (cdr)); | 454 end = Fcar (Fcdr (cdr)); |
455 | 455 |
456 if (!INTP (start) || !INTP (end)) | 456 if (!INTP (start) || !INTP (end)) |
510 ends up on the other side of the now-undeleted | 510 ends up on the other side of the now-undeleted |
511 text from point. Since undo doesn't even keep | 511 text from point. Since undo doesn't even keep |
512 track of the mark, this isn't really necessary, | 512 track of the mark, this isn't really necessary, |
513 but it may lead to better behavior in certain | 513 but it may lead to better behavior in certain |
514 situations. | 514 situations. |
515 | 515 |
516 I'm doubtful that this is safe; you could mess | 516 I'm doubtful that this is safe; you could mess |
517 up the process-output mark in shell buffers, so | 517 up the process-output mark in shell buffers, so |
518 until I hear a compelling reason for this change, | 518 until I hear a compelling reason for this change, |
519 I'm leaving it out. -jwz | 519 I'm leaving it out. -jwz |
520 */ | 520 */ |