/* Keyboard macros.
- Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1993, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include "window.h"
#include "keyboard.h"
-Lisp_Object Qexecute_kbd_macro;
+Lisp_Object Qexecute_kbd_macro, Qkbd_macro_termination_hook;
/* Kbd macro currently being executed (a string or vector). */
Use \\[end-kbd-macro] to finish recording and make the macro available.\n\
Use \\[name-last-kbd-macro] to give it a permanent name.\n\
Non-nil arg (prefix arg) means append to last macro defined;\n\
- This begins by re-executing that macro as if you typed it again.")
+this begins by re-executing that macro as if you typed it again.")
(append)
Lisp_Object append;
{
- current_kboard->kbd_macro_buffer)
== current_kboard->kbd_macro_bufsize)
{
- register Lisp_Object *new;
+ int offset = (current_kboard->kbd_macro_ptr
+ - current_kboard->kbd_macro_buffer);
current_kboard->kbd_macro_bufsize *= 2;
- new = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer,
- (current_kboard->kbd_macro_bufsize
- * sizeof (Lisp_Object)));
+ current_kboard->kbd_macro_buffer
+ = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer,
+ (current_kboard->kbd_macro_bufsize
+ * sizeof (Lisp_Object)));
current_kboard->kbd_macro_ptr
- += new - current_kboard->kbd_macro_buffer;
+ = current_kboard->kbd_macro_buffer + offset;
current_kboard->kbd_macro_end
- += new - current_kboard->kbd_macro_buffer;
- current_kboard->kbd_macro_buffer = new;
+ = (current_kboard->kbd_macro_buffer
+ + current_kboard->kbd_macro_bufsize);
}
+
*current_kboard->kbd_macro_ptr++ = c;
}
}
()
{
current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_end;
+ return Qnil;
}
DEFUN ("store-kbd-macro-event", Fstore_kbd_macro_event,
tem = XCDR (info);
executing_macro_index = XINT (XCAR (tem));
real_this_command = XCDR (tem);
+ Frun_hooks (1, &Qkbd_macro_termination_hook);
return Qnil;
}
{
Qexecute_kbd_macro = intern ("execute-kbd-macro");
staticpro (&Qexecute_kbd_macro);
+ Qkbd_macro_termination_hook = intern ("kbd-macro-termination-hook");
+ staticpro (&Qkbd_macro_termination_hook);
defsubr (&Sstart_kbd_macro);
defsubr (&Send_kbd_macro);