diff options
| author | Richard M. Stallman | 1994-05-07 08:38:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-05-07 08:38:28 +0000 |
| commit | e7a8b7911b45c73cab0c17130517c3d401c6b6d0 (patch) | |
| tree | c72e920584a2b30acbce94138aedbeec0d5ce803 /src | |
| parent | bad5d9129ffe7b02378130d5e0879cbbd7a905ff (diff) | |
| download | emacs-e7a8b7911b45c73cab0c17130517c3d401c6b6d0.tar.gz emacs-e7a8b7911b45c73cab0c17130517c3d401c6b6d0.zip | |
(record_delete): Record the old point value only right after a boundary.
(record_delete): Test last_point_position_buffer.
Diffstat (limited to 'src')
| -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) | |||
| 89 | int beg, length; | 89 | int beg, length; |
| 90 | { | 90 | { |
| 91 | Lisp_Object lbeg, lend, sbeg; | 91 | Lisp_Object lbeg, lend, sbeg; |
| 92 | int at_boundary; | ||
| 92 | 93 | ||
| 93 | if (EQ (current_buffer->undo_list, Qt)) | 94 | if (EQ (current_buffer->undo_list, Qt)) |
| 94 | return; | 95 | return; |
| @@ -101,6 +102,9 @@ record_delete (beg, length) | |||
| 101 | Fundo_boundary (); | 102 | Fundo_boundary (); |
| 102 | XSET (last_undo_buffer, Lisp_Buffer, current_buffer); | 103 | XSET (last_undo_buffer, Lisp_Buffer, current_buffer); |
| 103 | 104 | ||
| 105 | at_boundary = (CONSP (current_buffer->undo_list) | ||
| 106 | && NILP (XCONS (current_buffer->undo_list)->car)); | ||
| 107 | |||
| 104 | if (MODIFF <= current_buffer->save_modified) | 108 | if (MODIFF <= current_buffer->save_modified) |
| 105 | record_first_change (); | 109 | record_first_change (); |
| 106 | 110 | ||
| @@ -111,8 +115,11 @@ record_delete (beg, length) | |||
| 111 | XFASTINT (lbeg) = beg; | 115 | XFASTINT (lbeg) = beg; |
| 112 | XFASTINT (lend) = beg + length; | 116 | XFASTINT (lend) = beg + length; |
| 113 | 117 | ||
| 114 | /* If point wasn't at start of deleted range, record where it was. */ | 118 | /* If we are just after an undo boundary, and |
| 115 | if (last_point_position != XFASTINT (sbeg)) | 119 | point wasn't at start of deleted range, record where it was. */ |
| 120 | if (at_boundary | ||
| 121 | && last_point_position != XFASTINT (sbeg) | ||
| 122 | && current_buffer == XBUFFER (last_point_position_buffer)) | ||
| 116 | current_buffer->undo_list | 123 | current_buffer->undo_list |
| 117 | = Fcons (make_number (last_point_position), current_buffer->undo_list); | 124 | = Fcons (make_number (last_point_position), current_buffer->undo_list); |
| 118 | 125 | ||