Function: discard-input

discard-input is a function defined in keyboard.c.

Signature

(discard-input)

Documentation

Discard the contents of the terminal input buffer.

Also end any kbd macro being defined.

View in manual

Source Code

// Defined in /usr/src/emacs/src/keyboard.c
{
  if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
    {
      /* Discard the last command from the macro.  */
      Fcancel_kbd_macro_events ();
      end_kbd_macro ();
    }

  Vunread_command_events = Qnil;

  discard_tty_input ();

  kbd_fetch_ptr =  kbd_store_ptr;
  input_pending = false;

  return Qnil;
}