Mercurial > emacs
changeset 26069:6bf93a8f0e73
(print_preprocess): In case print-circle is nil,
add OBJ to Vprint_number_table only when OBJ is a symbol.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 18 Oct 1999 02:01:11 +0000 |
parents | 3803a546186f |
children | c83405930bcb |
files | src/print.c |
diffstat | 1 files changed, 36 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- 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)) {