which will be added to the list at the end of the command.
This ensures we can't run out of space while trying to make
an undo-boundary. */
-Lisp_Object pending_boundary;
+static Lisp_Object pending_boundary;
static void
undo_boundary (struct buffer *b)
if (EQ (b->undo_list, Qt))
return (0);
- if (NILP (last_undo_buffer) || b != XBUFFER (last_undo_buffer))
+ if (NILP (last_undo_buffer)
+ || (BUFFER_BASE_BUFFER (b)
+ != BUFFER_BASE_BUFFER (XBUFFER (last_undo_buffer))))
{
undo_boundary (b);
XSETBUFFER (last_undo_buffer, b);
}
void
-vars_of_undo (void)
+reinit_vars_of_undo (void)
{
inside_undo = 0;
+}
+
+void
+vars_of_undo (void)
+{
+ reinit_vars_of_undo ();
+
pending_boundary = Qnil;
staticpro (&pending_boundary);
last_undo_buffer = Qnil;