aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2002-08-19 14:58:29 +0000
committerKim F. Storm2002-08-19 14:58:29 +0000
commitab1959fcbaf8c87bc39b2e98a7511348709ae1fe (patch)
treee5ff9fa985d1ec1b9b8c7e32c2e723599d89e359 /src
parentdec7e3028842c114aa4b7bb9624b521865359e00 (diff)
downloademacs-ab1959fcbaf8c87bc39b2e98a7511348709ae1fe.tar.gz
emacs-ab1959fcbaf8c87bc39b2e98a7511348709ae1fe.zip
(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).
Diffstat (limited to 'src')
-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'. */)
9732} 9732}
9733 9733
9734DEFUN ("clear-this-command-keys", Fclear_this_command_keys, 9734DEFUN ("clear-this-command-keys", Fclear_this_command_keys,
9735 Sclear_this_command_keys, 0, 0, 0, 9735 Sclear_this_command_keys, 0, 1, 0,
9736 doc: /* Clear out the vector that `this-command-keys' returns. 9736 doc: /* Clear out the vector that `this-command-keys' returns.
9737Also clear the record of the last 100 events. */) 9737Also clear the record of the last 100 events, unless optional arg
9738 () 9738KEEP-RECORD is non-nil. */)
9739 (keep_record)
9740 Lisp_Object keep_record;
9739{ 9741{
9740 int i; 9742 int i;
9741 9743
9742 this_command_key_count = 0; 9744 this_command_key_count = 0;
9743 9745
9744 for (i = 0; i < XVECTOR (recent_keys)->size; ++i) 9746 if (NILP (keep_record))
9745 XVECTOR (recent_keys)->contents[i] = Qnil; 9747 {
9746 total_keys = 0; 9748 for (i = 0; i < XVECTOR (recent_keys)->size; ++i)
9747 recent_keys_index = 0; 9749 XVECTOR (recent_keys)->contents[i] = Qnil;
9750 total_keys = 0;
9751 recent_keys_index = 0;
9752 }
9748 return Qnil; 9753 return Qnil;
9749} 9754}
9750 9755