diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-05-07 08:38:28 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-05-07 08:38:28 +0000 |
commit | 8ef9282a6d817bcdeeb61e494a4689ddecdb25c5 (patch) | |
tree | 481e4bee0aeaa8dfd51131da1602412c4f3c5a8b /src/undo.c | |
parent | ebbe217c89931fee9f8538056151600c0515f5e6 (diff) | |
download | emacs-8ef9282a6d817bcdeeb61e494a4689ddecdb25c5.tar.gz |
(record_delete): Record the old point value only right after a boundary.
(record_delete): Test last_point_position_buffer.
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/undo.c b/src/undo.c index e9ba53f8631..4733694ff31 100644 --- a/src/undo.c +++ b/src/undo.c @@ -89,6 +89,7 @@ record_delete (beg, length) int beg, length; { Lisp_Object lbeg, lend, sbeg; + int at_boundary; if (EQ (current_buffer->undo_list, Qt)) return; @@ -101,6 +102,9 @@ record_delete (beg, length) 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 @@ record_delete (beg, length) 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); |