use dynwind_begin and dynwind_end
[bpt/emacs.git] / src / macros.c
index 768cb54..d82ec8b 100644 (file)
@@ -300,7 +300,7 @@ each iteration of the macro.  Iteration stops if LOOPFUNC returns nil.  */)
 {
   Lisp_Object final;
   Lisp_Object tem;
-  ptrdiff_t pdlcount = SPECPDL_INDEX ();
+  dynwind_begin ();
   EMACS_INT repeat = 1;
   struct gcpro gcpro1, gcpro2;
   EMACS_INT success_count = 0;
@@ -353,7 +353,8 @@ each iteration of the macro.  Iteration stops if LOOPFUNC returns nil.  */)
   Vreal_this_command = Vexecuting_kbd_macro;
 
   UNGCPRO;
-  return unbind_to (pdlcount, Qnil);
+  dynwind_end ();
+  return Qnil;
 }
 \f
 void