changeset 47347:28bab21524d4

(Fdiscard_input): If defining keyboard macro, end and save it instead of discarding it.
author Kim F. Storm <storm@cua.dk>
date Mon, 09 Sep 2002 22:33:36 +0000
parents 8287dca5eb2d
children 7e9809c820b0
files src/keyboard.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;