aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2002-09-09 22:33:36 +0000
committerKim F. Storm <[email protected]>2002-09-09 22:33:36 +0000
commit2b17d5ed901666e8ceebcaddd448c490d48ae2b6 (patch)
tree645ca439b6a71919a0f3f21e7e645f7fe9ae1622 /src/keyboard.c
parentd99f84968173f9dc32b34cd6ff1dd1fa1e2080b1 (diff)
(Fdiscard_input): If defining keyboard macro,
end and save it instead of discarding it.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 1f2227f419..76101090d4 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -9786,10 +9786,16 @@ If FILE is nil, close any open dribble file. */)
DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0,
doc: /* Discard the contents of the terminal input buffer.
-Also cancel any kbd macro being defined. */)
+Also end any kbd macro being defined. */)
()
{
- current_kboard->defining_kbd_macro = Qnil;
+ if (!NILP (current_kboard->defining_kbd_macro))
+ {
+ /* Discard the last command from the macro. */
+ Fcancel_kbd_macro_events ();
+ end_kbd_macro ();
+ }
+
update_mode_lines++;
Vunread_command_events = Qnil;