changeset 98295:a7da9fedfcf9

(record_point): Don't call Fundo_boundary for first change. (Bug#731)
author Martin Rudalics <rudalics@gmx.at>
date Mon, 22 Sep 2008 15:37:42 +0000
parents d6ab37532b9b
children 14386c19509d
files src/undo.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/undo.c	Mon Sep 22 15:21:40 2008 +0000
+++ b/src/undo.c	Mon Sep 22 15:37:42 2008 +0000
@@ -79,7 +79,13 @@
   if (NILP (pending_boundary))
     pending_boundary = Fcons (Qnil, Qnil);
 
-  if (current_buffer != last_undo_buffer)
+  if ((current_buffer != last_undo_buffer)
+      /* Don't call Fundo_boundary for the first change.  Otherwise we
+	 risk overwriting last_boundary_position in Fundo_boundary with
+	 PT of the current buffer and as a consequence not insert an
+	 undo boundary because last_boundary_position will equal pt in
+	 the test at the end of the present function (Bug#731).  */
+      && (MODIFF > SAVE_MODIFF))
     Fundo_boundary ();
   last_undo_buffer = current_buffer;