diff options
| author | Kenichi Handa | 1999-10-18 02:01:56 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-10-18 02:01:56 +0000 |
| commit | aca2020bdb42b5390b1796c8d230ad13f1396d8c (patch) | |
| tree | 7e5c1a23f53790c2a7118a8daa273fe58888d685 /src | |
| parent | b843d1aed4ea675ca01d63df16958e206a911d19 (diff) | |
| download | emacs-aca2020bdb42b5390b1796c8d230ad13f1396d8c.tar.gz emacs-aca2020bdb42b5390b1796c8d230ad13f1396d8c.zip | |
(print_preprocess): In case print-circle is nil,
add OBJ to Vprint_number_table only when OBJ is a symbol.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/print.c | 67 |
2 files changed, 41 insertions, 31 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e664129af30..22cb4e7443c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 1999-10-18 Keisuke Nishida <kxn30@po.cwru.edu> | ||
| 2 | |||
| 3 | * print.c (print_preprocess): In case print-circle is nil, | ||
| 4 | add OBJ to Vprint_number_table only when OBJ is a symbol. | ||
| 5 | |||
| 1 | 1999-10-08 Kenichi Handa <handa@etl.go.jp> | 6 | 1999-10-08 Kenichi Handa <handa@etl.go.jp> |
| 2 | 7 | ||
| 3 | * coding.c (code_convert_string): Add record_unwind_protect to | 8 | * coding.c (code_convert_string): Add record_unwind_protect to |
diff --git a/src/print.c b/src/print.c index dc28ed0ce11..163c23cb8be 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1110,42 +1110,47 @@ print_preprocess (obj) | |||
| 1110 | || (! NILP (Vprint_gensym) | 1110 | || (! NILP (Vprint_gensym) |
| 1111 | && SYMBOLP (obj) && NILP (XSYMBOL (obj)->obarray))) | 1111 | && SYMBOLP (obj) && NILP (XSYMBOL (obj)->obarray))) |
| 1112 | { | 1112 | { |
| 1113 | for (i = 0; i < print_number_index; i++) | 1113 | /* In case print-circle is nil and print-gensym is t, |
| 1114 | if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) | 1114 | add OBJ to Vprint_number_table only when OBJ is a symbol. */ |
| 1115 | { | 1115 | if (! NILP (Vprint_circle) || SYMBOLP (obj)) |
| 1116 | /* OBJ appears more than once. Let's remember that. */ | ||
| 1117 | PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt; | ||
| 1118 | return; | ||
| 1119 | } | ||
| 1120 | |||
| 1121 | /* OBJ is not yet recorded. Let's add to the table. */ | ||
| 1122 | if (print_number_index == 0) | ||
| 1123 | { | 1116 | { |
| 1124 | /* Initialize the table. */ | ||
| 1125 | Vprint_number_table = Fmake_vector (make_number (40), Qnil); | ||
| 1126 | } | ||
| 1127 | else if (XVECTOR (Vprint_number_table)->size == print_number_index * 2) | ||
| 1128 | { | ||
| 1129 | /* Reallocate the table. */ | ||
| 1130 | int i = print_number_index * 4; | ||
| 1131 | Lisp_Object old_table = Vprint_number_table; | ||
| 1132 | Vprint_number_table = Fmake_vector (make_number (i), Qnil); | ||
| 1133 | for (i = 0; i < print_number_index; i++) | 1117 | for (i = 0; i < print_number_index; i++) |
| 1118 | if (PRINT_NUMBER_OBJECT (Vprint_number_table, i) == obj) | ||
| 1119 | { | ||
| 1120 | /* OBJ appears more than once. Let's remember that. */ | ||
| 1121 | PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt; | ||
| 1122 | return; | ||
| 1123 | } | ||
| 1124 | |||
| 1125 | /* OBJ is not yet recorded. Let's add to the table. */ | ||
| 1126 | if (print_number_index == 0) | ||
| 1134 | { | 1127 | { |
| 1135 | PRINT_NUMBER_OBJECT (Vprint_number_table, i) | 1128 | /* Initialize the table. */ |
| 1136 | = PRINT_NUMBER_OBJECT (old_table, i); | 1129 | Vprint_number_table = Fmake_vector (make_number (40), Qnil); |
| 1137 | PRINT_NUMBER_STATUS (Vprint_number_table, i) | 1130 | } |
| 1138 | = PRINT_NUMBER_STATUS (old_table, i); | 1131 | else if (XVECTOR (Vprint_number_table)->size == print_number_index * 2) |
| 1132 | { | ||
| 1133 | /* Reallocate the table. */ | ||
| 1134 | int i = print_number_index * 4; | ||
| 1135 | Lisp_Object old_table = Vprint_number_table; | ||
| 1136 | Vprint_number_table = Fmake_vector (make_number (i), Qnil); | ||
| 1137 | for (i = 0; i < print_number_index; i++) | ||
| 1138 | { | ||
| 1139 | PRINT_NUMBER_OBJECT (Vprint_number_table, i) | ||
| 1140 | = PRINT_NUMBER_OBJECT (old_table, i); | ||
| 1141 | PRINT_NUMBER_STATUS (Vprint_number_table, i) | ||
| 1142 | = PRINT_NUMBER_STATUS (old_table, i); | ||
| 1143 | } | ||
| 1139 | } | 1144 | } |
| 1145 | PRINT_NUMBER_OBJECT (Vprint_number_table, print_number_index) = obj; | ||
| 1146 | /* If Vprint_continuous_numbering is non-nil and OBJ is a gensym, | ||
| 1147 | always print the gensym with a number. This is a special for | ||
| 1148 | the lisp function byte-compile-output-docform. */ | ||
| 1149 | if (! NILP (Vprint_continuous_numbering) && SYMBOLP (obj) | ||
| 1150 | && NILP (XSYMBOL (obj)->obarray)) | ||
| 1151 | PRINT_NUMBER_STATUS (Vprint_number_table, print_number_index) = Qt; | ||
| 1152 | print_number_index++; | ||
| 1140 | } | 1153 | } |
| 1141 | PRINT_NUMBER_OBJECT (Vprint_number_table, print_number_index) = obj; | ||
| 1142 | /* If Vprint_continuous_numbering is non-nil and OBJ is a gensym, | ||
| 1143 | always print the gensym with a number. This is a special for | ||
| 1144 | the lisp function byte-compile-output-docform. */ | ||
| 1145 | if (! NILP (Vprint_continuous_numbering) && SYMBOLP (obj) | ||
| 1146 | && NILP (XSYMBOL (obj)->obarray)) | ||
| 1147 | PRINT_NUMBER_STATUS (Vprint_number_table, print_number_index) = Qt; | ||
| 1148 | print_number_index++; | ||
| 1149 | 1154 | ||
| 1150 | switch (XGCTYPE (obj)) | 1155 | switch (XGCTYPE (obj)) |
| 1151 | { | 1156 | { |