summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-12-26 16:33:05 +0000
committerRichard M. Stallman <rms@gnu.org>2005-12-26 16:33:05 +0000
commit91e25f5e6f7c70de2e17cd4911bb07869cc9583f (patch)
treeb74f3dd37955f52928eb62628fb95570867d62e4 /src
parentbb0e1d19c7388910c113441dc131a85977e8b8ee (diff)
downloademacs-91e25f5e6f7c70de2e17cd4911bb07869cc9583f.tar.gz
Depend on window.h.
(record_point): Save old point from the correct window.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/undo.c16
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 @@
+2005-12-26 Richard M. Stallman <rms@gnu.org>
+
+ * undo.c: Depend on window.h.
+ (record_point): Save old point from the correct window.
+
+ * keyboard.c (last_point_position_window): New variable.
+ (command_loop_1): Set last_point_position_window.
+ (syms_of_keyboard): Init it.
+
+ * Makefile.in (undo.o): Depend on window.h.
+
2005-12-25 Richard M. Stallman <rms@gnu.org>
* 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. */
#include "lisp.h"
#include "buffer.h"
#include "commands.h"
+#include "window.h"
/* Limits controlling how much undo information to keep. */
@@ -100,12 +101,19 @@ record_point (pt)
/* If we are just after an undo boundary, and
point wasn't at start of deleted range, record where it was. */
if (at_boundary
- && last_point_position != pt
- /* If we're called from batch mode, this could be nil. */
&& BUFFERP (last_point_position_buffer)
+ /* If we're called from batch mode, this could be nil. */
&& current_buffer == XBUFFER (last_point_position_buffer))
- current_buffer->undo_list
- = Fcons (make_number (last_point_position), current_buffer->undo_list);
+ {
+ /* If we have switched windows, use the point value
+ from the window we are in. */
+ if (! EQ (last_point_position_window, selected_window))
+ last_point_position = marker_position (XWINDOW (selected_window)->pointm);
+
+ if (last_point_position != pt)
+ current_buffer->undo_list
+ = Fcons (make_number (last_point_position), current_buffer->undo_list);
+ }
}
/* Record an insertion that just happened or is about to happen,