- = Fcons (Fcons (Fbuffer_substring (lbeg, lend), sbeg),
+ = Fcons (Fcons (string, sbeg), current_buffer->undo_list);
+}
+
+/* Record the fact that MARKER is about to be adjusted by ADJUSTMENT.
+ This is done only when a marker points within text being deleted,
+ because that's the only case where an automatic marker adjustment
+ won't be inverted automatically by undoing the buffer modification. */
+
+void
+record_marker_adjustment (marker, adjustment)
+ Lisp_Object marker;
+ int adjustment;
+{
+ if (EQ (current_buffer->undo_list, Qt))
+ return;
+
+ /* Allocate a cons cell to be the undo boundary after this command. */
+ if (NILP (pending_boundary))
+ pending_boundary = Fcons (Qnil, Qnil);
+
+ if (current_buffer != XBUFFER (last_undo_buffer))
+ Fundo_boundary ();
+ XSETBUFFER (last_undo_buffer, current_buffer);
+
+ current_buffer->undo_list
+ = Fcons (Fcons (marker, make_number (adjustment)),