diff options
| author | Richard M. Stallman | 1998-04-23 21:25:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-04-23 21:25:55 +0000 |
| commit | f438538138a524421eefdd00a4591037a70c138e (patch) | |
| tree | c82a6549779c8f2b143c98e067de9dbf086f5de9 /src/keyboard.c | |
| parent | 746dd298217b2400c6b82c91261db7dec5fd6d65 (diff) | |
| download | emacs-f438538138a524421eefdd00a4591037a70c138e.tar.gz emacs-f438538138a524421eefdd00a4591037a70c138e.zip | |
(Fcommand_execute): Truncate command-history here.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 9c56699d7e4..c756ae7cb92 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -488,6 +488,8 @@ Lisp_Object Fthis_command_keys (); | |||
| 488 | Lisp_Object Qextended_command_history; | 488 | Lisp_Object Qextended_command_history; |
| 489 | EMACS_TIME timer_check (); | 489 | EMACS_TIME timer_check (); |
| 490 | 490 | ||
| 491 | extern Lisp_Object Vhistory_length; | ||
| 492 | |||
| 491 | extern char *x_get_keysym_name (); | 493 | extern char *x_get_keysym_name (); |
| 492 | 494 | ||
| 493 | static void record_menu_key (); | 495 | static void record_menu_key (); |
| @@ -7474,13 +7476,24 @@ a special event, so ignore the prefix argument and don't clear it.") | |||
| 7474 | other sorts of commands, call-interactively takes care of | 7476 | other sorts of commands, call-interactively takes care of |
| 7475 | this. */ | 7477 | this. */ |
| 7476 | if (!NILP (record_flag)) | 7478 | if (!NILP (record_flag)) |
| 7477 | Vcommand_history | 7479 | { |
| 7478 | = Fcons (Fcons (Qexecute_kbd_macro, | 7480 | Vcommand_history |
| 7479 | Fcons (final, Fcons (prefixarg, Qnil))), | 7481 | = Fcons (Fcons (Qexecute_kbd_macro, |
| 7480 | Vcommand_history); | 7482 | Fcons (final, Fcons (prefixarg, Qnil))), |
| 7483 | Vcommand_history); | ||
| 7484 | |||
| 7485 | /* Don't keep command history around forever. */ | ||
| 7486 | if (NUMBERP (Vhistory_length) && XINT (Vhistory_length) > 0) | ||
| 7487 | { | ||
| 7488 | tem = Fnthcdr (Vhistory_length, Vcommand_history); | ||
| 7489 | if (CONSP (tem)) | ||
| 7490 | XCONS (tem)->cdr = Qnil; | ||
| 7491 | } | ||
| 7492 | } | ||
| 7481 | 7493 | ||
| 7482 | return Fexecute_kbd_macro (final, prefixarg); | 7494 | return Fexecute_kbd_macro (final, prefixarg); |
| 7483 | } | 7495 | } |
| 7496 | |||
| 7484 | if (CONSP (final) || SUBRP (final) || COMPILEDP (final)) | 7497 | if (CONSP (final) || SUBRP (final) || COMPILEDP (final)) |
| 7485 | { | 7498 | { |
| 7486 | backtrace.next = backtrace_list; | 7499 | backtrace.next = backtrace_list; |