# HG changeset patch # User Kenichi Handa # Date 940212071 0 # Node ID 6bf93a8f0e734259ad10d3955d997567a98d4a69 # Parent 3803a546186f65e4137ef4278e481a93174cd7a4 (print_preprocess): In case print-circle is nil, add OBJ to Vprint_number_table only when OBJ is a symbol. diff -r 3803a546186f -r 6bf93a8f0e73 src/print.c --- a/src/print.c Mon Oct 18 01:36:35 1999 +0000 +++ b/src/print.c Mon Oct 18 02:01:11 1999 +0000 @@ -1110,42 +1110,47 @@ || (! NILP (Vprint_gensym) && SYMBOLP (obj) && NILP (XSYMBOL (obj)->obarray))) { - for (i = 0; i < print_number_index; i++) - if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) - { - /* OBJ appears more than once. Let's remember that. */ - PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt; - return; - } - - /* OBJ is not yet recorded. Let's add to the table. */ - if (print_number_index == 0) - { - /* Initialize the table. */ - Vprint_number_table = Fmake_vector (make_number (40), Qnil); - } - else if (XVECTOR (Vprint_number_table)->size == print_number_index * 2) + /* In case print-circle is nil and print-gensym is t, + add OBJ to Vprint_number_table only when OBJ is a symbol. */ + if (! NILP (Vprint_circle) || SYMBOLP (obj)) { - /* Reallocate the table. */ - int i = print_number_index * 4; - Lisp_Object old_table = Vprint_number_table; - Vprint_number_table = Fmake_vector (make_number (i), Qnil); for (i = 0; i < print_number_index; i++) + if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) + { + /* OBJ appears more than once. Let's remember that. */ + PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt; + return; + } + + /* OBJ is not yet recorded. Let's add to the table. */ + if (print_number_index == 0) + { + /* Initialize the table. */ + Vprint_number_table = Fmake_vector (make_number (40), Qnil); + } + else if (XVECTOR (Vprint_number_table)->size == print_number_index * 2) { - PRINT_NUMBER_OBJECT (Vprint_number_table, i) - = PRINT_NUMBER_OBJECT (old_table, i); - PRINT_NUMBER_STATUS (Vprint_number_table, i) - = PRINT_NUMBER_STATUS (old_table, i); + /* Reallocate the table. */ + int i = print_number_index * 4; + Lisp_Object old_table = Vprint_number_table; + Vprint_number_table = Fmake_vector (make_number (i), Qnil); + for (i = 0; i < print_number_index; i++) + { + PRINT_NUMBER_OBJECT (Vprint_number_table, i) + = PRINT_NUMBER_OBJECT (old_table, i); + PRINT_NUMBER_STATUS (Vprint_number_table, i) + = PRINT_NUMBER_STATUS (old_table, i); + } } + 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++; } - 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)) {