use dynwind_begin and dynwind_end
[bpt/emacs.git] / src / macros.c
index d0cf3c2..d82ec8b 100644 (file)
@@ -45,8 +45,6 @@ EMACS_INT executing_kbd_macro_iterations;
 
 Lisp_Object executing_kbd_macro;
 
-Lisp_Object Fexecute_kbd_macro (Lisp_Object macro, Lisp_Object count, Lisp_Object loopfunc);
-\f
 DEFUN ("start-kbd-macro", Fstart_kbd_macro, Sstart_kbd_macro, 1, 2, "P",
        doc: /* Record subsequent keyboard input, defining a keyboard macro.
 The commands are recorded even as they are executed.
@@ -302,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;
@@ -355,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
@@ -368,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,
@@ -376,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