diff options
| author | Karl Heuer | 1994-03-03 20:12:01 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-03-03 20:12:01 +0000 |
| commit | 4e665715b9645a4c381f66f01c2cf5f93f97aabc (patch) | |
| tree | 0ee84cbb936953436691865a8a1203c1b02bc3ab | |
| parent | 01314b95faa6b1223345782b3ff568d742411989 (diff) | |
| download | emacs-4e665715b9645a4c381f66f01c2cf5f93f97aabc.tar.gz emacs-4e665715b9645a4c381f66f01c2cf5f93f97aabc.zip | |
(record_delete): Save last_point_position in the undo record, rather than the
current value of point.
| -rw-r--r-- | src/undo.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/undo.c b/src/undo.c index a0e9f84f7c9..64f773d62c8 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -22,6 +22,7 @@ and this notice must be preserved on all copies. */ | |||
| 22 | #include <config.h> | 22 | #include <config.h> |
| 23 | #include "lisp.h" | 23 | #include "lisp.h" |
| 24 | #include "buffer.h" | 24 | #include "buffer.h" |
| 25 | #include "commands.h" | ||
| 25 | 26 | ||
| 26 | /* Last buffer for which undo information was recorded. */ | 27 | /* Last buffer for which undo information was recorded. */ |
| 27 | Lisp_Object last_undo_buffer; | 28 | Lisp_Object last_undo_buffer; |
| @@ -95,10 +96,10 @@ record_delete (beg, length) | |||
| 95 | XFASTINT (lbeg) = beg; | 96 | XFASTINT (lbeg) = beg; |
| 96 | XFASTINT (lend) = beg + length; | 97 | XFASTINT (lend) = beg + length; |
| 97 | 98 | ||
| 98 | /* If point isn't at start of deleted range, record where it is. */ | 99 | /* If point wasn't at start of deleted range, record where it was. */ |
| 99 | if (PT != XFASTINT (sbeg)) | 100 | if (last_point_position != XFASTINT (sbeg)) |
| 100 | current_buffer->undo_list | 101 | current_buffer->undo_list |
| 101 | = Fcons (make_number (PT), current_buffer->undo_list); | 102 | = Fcons (make_number (last_point_position), current_buffer->undo_list); |
| 102 | 103 | ||
| 103 | current_buffer->undo_list | 104 | current_buffer->undo_list |
| 104 | = Fcons (Fcons (Fbuffer_substring (lbeg, lend), sbeg), | 105 | = Fcons (Fcons (Fbuffer_substring (lbeg, lend), sbeg), |