diff options
author | Karl Heuer <kwzh@gnu.org> | 1994-03-03 20:12:01 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1994-03-03 20:12:01 +0000 |
commit | e6fd727e87ac2c5a51f3f71b07550be0656f11a7 (patch) | |
tree | ab1a3ba5e68c93deb8eca1b3c42c4298a4d5f274 /src/undo.c | |
parent | 271e70a9b3c89006c9af9a3e2b34d76c39fe2dce (diff) | |
download | emacs-e6fd727e87ac2c5a51f3f71b07550be0656f11a7.tar.gz |
(record_delete): Save last_point_position in the undo record, rather than the
current value of point.
Diffstat (limited to 'src/undo.c')
-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. */ #include <config.h> #include "lisp.h" #include "buffer.h" +#include "commands.h" /* Last buffer for which undo information was recorded. */ Lisp_Object last_undo_buffer; @@ -95,10 +96,10 @@ record_delete (beg, length) XFASTINT (lbeg) = beg; XFASTINT (lend) = beg + length; - /* If point isn't at start of deleted range, record where it is. */ - if (PT != XFASTINT (sbeg)) + /* If point wasn't at start of deleted range, record where it was. */ + if (last_point_position != XFASTINT (sbeg)) current_buffer->undo_list - = Fcons (make_number (PT), current_buffer->undo_list); + = Fcons (make_number (last_point_position), current_buffer->undo_list); current_buffer->undo_list = Fcons (Fcons (Fbuffer_substring (lbeg, lend), sbeg), |