Lisp_Object list;
Lisp_Object prev, next, last_boundary;
EMACS_INT size_so_far = 0;
-
- /* Make sure that calling undo-outer-limit-function
- won't cause another GC. */
- ptrdiff_t count = inhibit_garbage_collection ();
+ dynwind_begin ();
+ static const size_t sizeof_cons = sizeof (scm_t_cell);
/* Make the buffer current to get its local values of variables such
as undo_limit. Also so that Vundo_outer_limit_function can
if (CONSP (next) && NILP (XCAR (next)))
{
/* Add in the space occupied by this element and its chain link. */
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof_cons;
/* Advance to next element. */
prev = next;
elt = XCAR (next);
/* Add in the space occupied by this element and its chain link. */
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof_cons;
if (CONSP (elt))
{
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof_cons;
if (STRINGP (XCAR (elt)))
size_so_far += (sizeof (struct Lisp_String) - 1
+ SCHARS (XCAR (elt)));
{
/* The function is responsible for making
any desired changes in buffer-undo-list. */
- unbind_to (count, Qnil);
+ dynwind_end ();
return;
}
/* That function probably used the minibuffer, and if so, that
}
/* Add in the space occupied by this element and its chain link. */
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof_cons;
if (CONSP (elt))
{
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof_cons;
if (STRINGP (XCAR (elt)))
size_so_far += (sizeof (struct Lisp_String) - 1
+ SCHARS (XCAR (elt)));
else
bset_undo_list (b, Qnil);
- unbind_to (count, Qnil);
+ dynwind_end ();
}
\f
void
syms_of_undo (void)
{
+#include "undo.x"
+
DEFSYM (Qinhibit_read_only, "inhibit-read-only");
DEFSYM (Qapply, "apply");
last_undo_buffer = NULL;
last_boundary_buffer = NULL;
- defsubr (&Sundo_boundary);
-
DEFVAR_INT ("undo-limit", undo_limit,
doc: /* Keep no more undo information once it exceeds this size.
This limit is applied when garbage collection happens.