Mercurial > emacs
comparison src/undo.c @ 6180:d369907be635
(record_delete): Save last_point_position in the undo record, rather than the
current value of point.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 03 Mar 1994 20:12:01 +0000 |
parents | 099857a46901 |
children | a147d798ed0d |
comparison
equal
deleted
inserted
replaced
6179:e2bb2d0b8a00 | 6180:d369907be635 |
---|---|
20 | 20 |
21 | 21 |
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; |
28 | 29 |
29 Lisp_Object Qinhibit_read_only; | 30 Lisp_Object Qinhibit_read_only; |
93 else | 94 else |
94 XFASTINT (sbeg) = beg; | 95 XFASTINT (sbeg) = beg; |
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), |
105 current_buffer->undo_list); | 106 current_buffer->undo_list); |
106 } | 107 } |