# HG changeset patch # User Richard M. Stallman # Date 768299908 0 # Node ID 99e9c133a752ceccbd055f5a5397621e49b590fc # Parent 6106d22ab2ca9874376660370b589629f14a68ae (record_delete): Record the old point value only right after a boundary. (record_delete): Test last_point_position_buffer. diff -r 6106d22ab2ca -r 99e9c133a752 src/undo.c --- a/src/undo.c Sat May 07 05:31:39 1994 +0000 +++ b/src/undo.c Sat May 07 08:38:28 1994 +0000 @@ -89,6 +89,7 @@ int beg, length; { Lisp_Object lbeg, lend, sbeg; + int at_boundary; if (EQ (current_buffer->undo_list, Qt)) return; @@ -101,6 +102,9 @@ Fundo_boundary (); XSET (last_undo_buffer, Lisp_Buffer, current_buffer); + at_boundary = (CONSP (current_buffer->undo_list) + && NILP (XCONS (current_buffer->undo_list)->car)); + if (MODIFF <= current_buffer->save_modified) record_first_change (); @@ -111,8 +115,11 @@ XFASTINT (lbeg) = beg; XFASTINT (lend) = beg + length; - /* If point wasn't at start of deleted range, record where it was. */ - if (last_point_position != XFASTINT (sbeg)) + /* If we are just after an undo boundary, and + point wasn't at start of deleted range, record where it was. */ + if (at_boundary + && last_point_position != XFASTINT (sbeg) + && current_buffer == XBUFFER (last_point_position_buffer)) current_buffer->undo_list = Fcons (make_number (last_point_position), current_buffer->undo_list);