changeset 16538:1e1026e6cd9d

(Fgarbage_collect): Use Vhistory_length for truncating Vcommand_history.
author Richard M. Stallman <rms@gnu.org>
date Thu, 07 Nov 1996 21:14:18 +0000
parents f47030b411f9
children 901db650f48e
files src/alloc.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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.  */
   {