/* Keyboard macros.
- Copyright (C) 1985, 1986 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
error ("Already defining kbd macro");
update_mode_lines++;
- if (NULL (append))
+ if (NILP (append))
{
kbd_macro_ptr = kbd_macro_buffer;
kbd_macro_end = kbd_macro_buffer;
if (!defining_kbd_macro)
error ("Not defining kbd macro.");
- if (NULL (arg))
+ if (NILP (arg))
XFASTINT (arg) = 1;
else
CHECK_NUMBER (arg, 0);
{
defining_kbd_macro = 0;
update_mode_lines++;
- Vlast_kbd_macro = make_array (kbd_macro_end - kbd_macro_buffer,
- kbd_macro_buffer);
+ Vlast_kbd_macro = make_event_array (kbd_macro_end - kbd_macro_buffer,
+ kbd_macro_buffer);
message("Keyboard macro defined");
}
Fexecute_kbd_macro (Vlast_kbd_macro, arg);
else
{
- XFASTINT (arg)--;
- if (XFASTINT (arg) > 0)
+ XSETINT (arg, XINT (arg)-1);
+ if (XINT (arg) > 0)
Fexecute_kbd_macro (Vlast_kbd_macro, arg);
}
return Qnil;
{
if (defining_kbd_macro)
error ("Can't execute anonymous macro while defining one");
- else if (NULL (Vlast_kbd_macro))
+ else if (NILP (Vlast_kbd_macro))
error ("No kbd macro has been defined");
else
Fexecute_kbd_macro (Vlast_kbd_macro, prefix);
int repeat = 1;
struct gcpro gcpro1;
- if (!NULL (prefixarg))
+ if (!NILP (prefixarg))
prefixarg = Fprefix_numeric_value (prefixarg),
repeat = XINT (prefixarg);
- final = macro;
- while (XTYPE (final) == Lisp_Symbol && !EQ (final, Qunbound))
- final = XSYMBOL (final)->function;
+ final = indirect_function (macro);
if (XTYPE (final) != Lisp_String
&& XTYPE (final) != Lisp_Vector)
error ("Keyboard macros must be strings or vectors.");
executing_macro_index = 0;
command_loop_1 ();
+
+ QUIT;
}
while (--repeat && (XTYPE (Vexecuting_macro) == Lisp_String
|| XTYPE (Vexecuting_macro) == Lisp_Vector));