changeset 25957:1751b057e4b0

(print): When removing objects from Vprint_number_table, only scan the newly added objects. (print_preprocess): If OBJ is a gensym, and print-continuous-numbering, unconditionally force it to stay in the table.
author Richard M. Stallman <rms@gnu.org>
date Sat, 09 Oct 1999 22:54:25 +0000
parents 6f9d624b1ba7
children a3e5e34a730a
files src/print.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/print.c	Sat Oct 09 19:58:13 1999 +0000
+++ b/src/print.c	Sat Oct 09 22:54:25 1999 +0000
@@ -1069,12 +1069,13 @@
   /* Construct Vprint_number_table for print-gensym and print-circle.  */
   if (!NILP (Vprint_gensym) || !NILP (Vprint_circle))
     {
-      int i, index = 0;
+      int i, start, index;
       /* Construct Vprint_number_table.  */
+      start = index = print_number_index;
       print_preprocess (obj);
       /* Remove unnecessary objects, which appear only once in OBJ;
 	 that is, whose status is Qnil.  */
-      for (i = 0; i < print_number_index; i++)
+      for (i = start; i < print_number_index; i++)
 	if (!NILP (PRINT_NUMBER_STATUS (Vprint_number_table, i)))
 	  {
 	    PRINT_NUMBER_OBJECT (Vprint_number_table, index)
@@ -1138,6 +1139,12 @@
 	    }
 	}
       PRINT_NUMBER_OBJECT (Vprint_number_table, print_number_index) = obj;
+      /* If Vprint_continuous_numbering is non-nil and OBJ is a gensym,
+	 always print the gensym with a number.  This is a special for
+	 the lisp function byte-compile-output-docform.  */
+      if (! NILP (Vprint_continuous_numbering) && SYMBOLP (obj)
+	  && NILP (XSYMBOL (obj)->obarray))
+	PRINT_NUMBER_STATUS (Vprint_number_table, print_number_index) = Qt;
       print_number_index++;
 
       switch (XGCTYPE (obj))