# HG changeset patch # User Richard M. Stallman # Date 847401258 0 # Node ID 1e1026e6cd9d4dbe29e40f7cb472baa98e0c5cb6 # Parent f47030b411f9b8792a4090f9c2251f4a5fed8888 (Fgarbage_collect): Use Vhistory_length for truncating Vcommand_history. diff -r f47030b411f9 -r 1e1026e6cd9d src/alloc.c --- a/src/alloc.c Thu Nov 07 21:13:22 1996 +0000 +++ b/src/alloc.c Thu Nov 07 21:14:18 1996 +0000 @@ -48,6 +48,8 @@ extern __malloc_size_t _bytes_used; extern int __malloc_extra_blocks; +extern Lisp_Object Vhistory_length; + #define max(A,B) ((A) > (B) ? (A) : (B)) #define min(A,B) ((A) < (B) ? (A) : (B)) @@ -1497,10 +1499,13 @@ if (garbage_collection_messages) message1_nolog ("Garbage collecting..."); - /* Don't keep command history around forever */ - tem = Fnthcdr (make_number (30), Vcommand_history); - if (CONSP (tem)) - XCONS (tem)->cdr = Qnil; + /* Don't keep command history around forever. */ + if (NUMBERP (Vhistory_length) && XINT (Vhistory_length) > 0) + { + tem = Fnthcdr (Vhistory_length, Vcommand_history); + if (CONSP (tem)) + XCONS (tem)->cdr = Qnil; + } /* Likewise for undo information. */ {