use dynwind_begin and dynwind_end
[bpt/emacs.git] / src / macros.c
index acba125..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
@@ -366,6 +367,8 @@ init_macros (void)
 void
 syms_of_macros (void)
 {
+#include "macros.x"
+
   DEFSYM (Qexecute_kbd_macro, "execute-kbd-macro");
 
   DEFVAR_LISP ("kbd-macro-termination-hook", Vkbd_macro_termination_hook,
@@ -374,13 +377,6 @@ This is run whether the macro ends normally or prematurely due to an error.  */)
   Vkbd_macro_termination_hook = Qnil;
   DEFSYM (Qkbd_macro_termination_hook, "kbd-macro-termination-hook");
 
-  defsubr (&Sstart_kbd_macro);
-  defsubr (&Send_kbd_macro);
-  defsubr (&Scall_last_kbd_macro);
-  defsubr (&Sexecute_kbd_macro);
-  defsubr (&Scancel_kbd_macro_events);
-  defsubr (&Sstore_kbd_macro_event);
-
   DEFVAR_KBOARD ("defining-kbd-macro", defining_kbd_macro,
                 doc: /* Non-nil while a keyboard macro is being defined.  Don't set this!
 The value is the symbol `append' while appending to the definition of