]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fdiscard_input): If defining keyboard macro,
authorKim F. Storm <storm@cua.dk>
Mon, 9 Sep 2002 22:33:36 +0000 (22:33 +0000)
committerKim F. Storm <storm@cua.dk>
Mon, 9 Sep 2002 22:33:36 +0000 (22:33 +0000)
end and save it instead of discarding it.

src/keyboard.c

index 1f2227f419aa62377fd8780c7a0a0eaee0ddcaf0..76101090d4c122af5b12f70cddd38143f6843c1a 100644 (file)
@@ -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;