diff src/macros.c @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents 7df0dd720c89
children 341dac730539
line wrap: on
line diff
--- a/src/macros.c	Mon Aug 13 10:33:19 2007 +0200
+++ b/src/macros.c	Mon Aug 13 10:34:13 2007 +0200
@@ -87,7 +87,7 @@
   return Qnil;
 }
 
-DEFUN ("end-kbd-macro", Fend_kbd_macro, 0, 2, "P", /*
+DEFUN ("end-kbd-macro", Fend_kbd_macro, 0, 1, "P", /*
 Finish defining a keyboard macro.
 The definition was started by \\[start-kbd-macro].
 The macro is now available for use via \\[call-last-kbd-macro],
@@ -97,29 +97,16 @@
 With numeric arg, repeat macro now that many times,
 counting the definition just completed as the first repetition.
 An argument of zero means repeat until error.
-
-If REMOVE-LAST is an integer, it means to not record the last number
-of events.  This is used internally and will likely be removed.
 */
-       (arg, remove_last))
+       (arg))
 {
   /* This function can GC */
   struct console *con = XCONSOLE (Vselected_console);
-  int repeat, kill;
+  int repeat;
 
   if (NILP (con->defining_kbd_macro))
     error ("Not defining kbd macro.");
 
-  /* #### Read the comment in modeline.el to see why this ugliness is
-     needed.  #### Try to avoid it, somehow!  */
-  if (!NILP (remove_last))
-    {
-      CHECK_NATNUM (remove_last);
-      kill = XINT (remove_last);
-    }
-  else
-    kill = 0;
-
   if (NILP (arg))
     repeat = -1;
   else
@@ -128,7 +115,7 @@
   if (!NILP (con->defining_kbd_macro))
     {
       int i;
-      int size = con->kbd_macro_end - kill;
+      int size = con->kbd_macro_end;
 
       if (size < 0)
 	size = 0;
@@ -152,6 +139,18 @@
 			       make_int (repeat - 1));
 }
 
+/* #### Read the comment in modeline.el to see why this ugliness is
+   needed.  #### Try to avoid it, somehow!  */
+DEFUN ("zap-last-kbd-macro-event", Fzap_last_kbd_macro_event, 0, 0, 0, /*
+Don't look at this lest you vomit or spontaneously combust.
+*/
+       ())
+{
+  struct console *con = XCONSOLE (Vselected_console);
+  if (con->kbd_macro_end)
+    --con->kbd_macro_end;
+  return Qnil;
+}
 
 /* Store event into kbd macro being defined
  */
@@ -304,6 +303,7 @@
 {
   DEFSUBR (Fstart_kbd_macro);
   DEFSUBR (Fend_kbd_macro);
+  DEFSUBR (Fzap_last_kbd_macro_event);
   DEFSUBR (Fcall_last_kbd_macro);
   DEFSUBR (Fexecute_kbd_macro);
   DEFSUBR (Fcancel_kbd_macro_events);