# HG changeset patch # User Kim F. Storm # Date 1029769109 0 # Node ID 775e763fdaf2177ea03e33b49cc3f44a9330bd98 # Parent 664bdd6d9a5812d052096eca4089ce242fee6eef (Fclear_this_command_keys): Added optional arg KEEP-RECORD to avoid clearing lossage when we just want to clear the current key sequence (kmacro needs this). diff -r 664bdd6d9a58 -r 775e763fdaf2 src/keyboard.c --- a/src/keyboard.c Mon Aug 19 14:57:49 2002 +0000 +++ b/src/keyboard.c Mon Aug 19 14:58:29 2002 +0000 @@ -9732,19 +9732,24 @@ } DEFUN ("clear-this-command-keys", Fclear_this_command_keys, - Sclear_this_command_keys, 0, 0, 0, + Sclear_this_command_keys, 0, 1, 0, doc: /* Clear out the vector that `this-command-keys' returns. -Also clear the record of the last 100 events. */) - () +Also clear the record of the last 100 events, unless optional arg +KEEP-RECORD is non-nil. */) + (keep_record) + Lisp_Object keep_record; { int i; this_command_key_count = 0; - for (i = 0; i < XVECTOR (recent_keys)->size; ++i) - XVECTOR (recent_keys)->contents[i] = Qnil; - total_keys = 0; - recent_keys_index = 0; + if (NILP (keep_record)) + { + for (i = 0; i < XVECTOR (recent_keys)->size; ++i) + XVECTOR (recent_keys)->contents[i] = Qnil; + total_keys = 0; + recent_keys_index = 0; + } return Qnil; }