# HG changeset patch # User Richard M. Stallman # Date 893366298 0 # Node ID 46ffb5302c405f79606d8d2178d461dd1327db8c # Parent b1ee274d921b1bb43acd29bf53c8c412737668f2 (Fcall_interactively): Truncate command-history here. diff -r b1ee274d921b -r 46ffb5302c40 src/callint.c --- a/src/callint.c Thu Apr 23 18:00:06 1998 +0000 +++ b/src/callint.c Thu Apr 23 21:18:18 1998 +0000 @@ -35,6 +35,8 @@ Lisp_Object Qcall_interactively; Lisp_Object Vcommand_history; +extern Lisp_Object Vhistory_length; + Lisp_Object Vcommand_debug_status, Qcommand_debug_status; Lisp_Object Qenable_recursive_minibuffers; @@ -345,6 +347,14 @@ } Vcommand_history = Fcons (Fcons (function, values), Vcommand_history); + + /* Don't keep command history around forever. */ + if (NUMBERP (Vhistory_length) && XINT (Vhistory_length) > 0) + { + teml = Fnthcdr (Vhistory_length, Vcommand_history); + if (CONSP (teml)) + XCONS (teml)->cdr = Qnil; + } } single_kboard_state (); return apply1 (function, specs); @@ -728,6 +738,13 @@ } Vcommand_history = Fcons (Flist (count + 1, visargs), Vcommand_history); + /* Don't keep command history around forever. */ + if (NUMBERP (Vhistory_length) && XINT (Vhistory_length) > 0) + { + teml = Fnthcdr (Vhistory_length, Vcommand_history); + if (CONSP (teml)) + XCONS (teml)->cdr = Qnil; + } } /* If we used a marker to hold point, mark, or an end of the region,