summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2002-08-19 14:58:29 +0000
committerKim F. Storm <storm@cua.dk>2002-08-19 14:58:29 +0000
commitab1959fcbaf8c87bc39b2e98a7511348709ae1fe (patch)
treee5ff9fa985d1ec1b9b8c7e32c2e723599d89e359
parentdec7e3028842c114aa4b7bb9624b521865359e00 (diff)
downloademacs-ab1959fcbaf8c87bc39b2e98a7511348709ae1fe.tar.gz
(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).
-rw-r--r--src/keyboard.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 5fd8cf1933a..1f2227f419a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -9732,19 +9732,24 @@ appears in the echo area and in the value of `this-command-keys'. */)
}
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;
}