# HG changeset patch # User Kim F. Storm # Date 1031610816 0 # Node ID 28bab21524d4197198590c75405229b17d817db5 # Parent 8287dca5eb2d308ef429872674cc3e1bbc93b790 (Fdiscard_input): If defining keyboard macro, end and save it instead of discarding it. diff -r 8287dca5eb2d -r 28bab21524d4 src/keyboard.c --- a/src/keyboard.c Mon Sep 09 22:09:14 2002 +0000 +++ b/src/keyboard.c Mon Sep 09 22:33:36 2002 +0000 @@ -9786,10 +9786,16 @@ 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;