diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/undo.c | 16 |
2 files changed, 23 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1fca3cc1baa..43cfd1e5e15 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2005-12-26 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * undo.c: Depend on window.h. | ||
| 4 | (record_point): Save old point from the correct window. | ||
| 5 | |||
| 6 | * keyboard.c (last_point_position_window): New variable. | ||
| 7 | (command_loop_1): Set last_point_position_window. | ||
| 8 | (syms_of_keyboard): Init it. | ||
| 9 | |||
| 10 | * Makefile.in (undo.o): Depend on window.h. | ||
| 11 | |||
| 1 | 2005-12-25 Richard M. Stallman <rms@gnu.org> | 12 | 2005-12-25 Richard M. Stallman <rms@gnu.org> |
| 2 | 13 | ||
| 3 | * eval.c (un_autoload): Expect (0 . OFEATURES) in Vautoload_queue | 14 | * eval.c (un_autoload): Expect (0 . OFEATURES) in Vautoload_queue |
diff --git a/src/undo.c b/src/undo.c index ecbb714fddd..bf774affac5 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -24,6 +24,7 @@ Boston, MA 02110-1301, USA. */ | |||
| 24 | #include "lisp.h" | 24 | #include "lisp.h" |
| 25 | #include "buffer.h" | 25 | #include "buffer.h" |
| 26 | #include "commands.h" | 26 | #include "commands.h" |
| 27 | #include "window.h" | ||
| 27 | 28 | ||
| 28 | /* Limits controlling how much undo information to keep. */ | 29 | /* Limits controlling how much undo information to keep. */ |
| 29 | 30 | ||
| @@ -100,12 +101,19 @@ record_point (pt) | |||
| 100 | /* If we are just after an undo boundary, and | 101 | /* If we are just after an undo boundary, and |
| 101 | point wasn't at start of deleted range, record where it was. */ | 102 | point wasn't at start of deleted range, record where it was. */ |
| 102 | if (at_boundary | 103 | if (at_boundary |
| 103 | && last_point_position != pt | ||
| 104 | /* If we're called from batch mode, this could be nil. */ | ||
| 105 | && BUFFERP (last_point_position_buffer) | 104 | && BUFFERP (last_point_position_buffer) |
| 105 | /* If we're called from batch mode, this could be nil. */ | ||
| 106 | && current_buffer == XBUFFER (last_point_position_buffer)) | 106 | && current_buffer == XBUFFER (last_point_position_buffer)) |
| 107 | current_buffer->undo_list | 107 | { |
| 108 | = Fcons (make_number (last_point_position), current_buffer->undo_list); | 108 | /* If we have switched windows, use the point value |
| 109 | from the window we are in. */ | ||
| 110 | if (! EQ (last_point_position_window, selected_window)) | ||
| 111 | last_point_position = marker_position (XWINDOW (selected_window)->pointm); | ||
| 112 | |||
| 113 | if (last_point_position != pt) | ||
| 114 | current_buffer->undo_list | ||
| 115 | = Fcons (make_number (last_point_position), current_buffer->undo_list); | ||
| 116 | } | ||
| 109 | } | 117 | } |
| 110 | 118 | ||
| 111 | /* Record an insertion that just happened or is about to happen, | 119 | /* Record an insertion that just happened or is about to happen, |