misc changes
[bpt/emacs.git] / src / undo.c
index b81f1ae..66b038e 100644 (file)
@@ -328,7 +328,7 @@ truncate_undo_list (struct buffer *b)
   Lisp_Object list;
   Lisp_Object prev, next, last_boundary;
   EMACS_INT size_so_far = 0;
-  ptrdiff_t count = SPECPDL_INDEX ();
+  dynwind_begin ();
   static const size_t sizeof_cons = sizeof (scm_t_cell);
 
   /* Make the buffer current to get its local values of variables such
@@ -395,7 +395,7 @@ truncate_undo_list (struct buffer *b)
        {
          /* 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
@@ -451,13 +451,15 @@ truncate_undo_list (struct buffer *b)
   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");
 
@@ -467,8 +469,6 @@ syms_of_undo (void)
   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.