+ /* 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)
+ && current_buffer == XBUFFER (last_point_position_buffer))
+ 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,
+ for LENGTH characters at position BEG.
+ (It is possible to record an insertion before or after the fact
+ because we don't need to record the contents.) */
+
+void
+record_insert (beg, length)
+ int beg, length;
+{
+ Lisp_Object lbeg, lend;
+
+ if (EQ (current_buffer->undo_list, Qt))
+ return;
+
+ record_point (beg);
+