aboutsummaryrefslogtreecommitdiffstats
path: root/src/print.c
diff options
context:
space:
mode:
authorPaul Eggert2011-03-17 09:32:03 -0700
committerPaul Eggert2011-03-17 09:32:03 -0700
commitb1d876f1a19ae65c8a8dd61c4ce17055ca53f16c (patch)
tree5dd8a40d7e3e0b86749cecfee7443ad81bdbfe5e /src/print.c
parentb766f86726fc2828a035cb8db149598a3a84de96 (diff)
parentd6cd56f187a791983579bf5d4ce3702d2ddf2499 (diff)
downloademacs-b1d876f1a19ae65c8a8dd61c4ce17055ca53f16c.tar.gz
emacs-b1d876f1a19ae65c8a8dd61c4ce17055ca53f16c.zip
Merge from mainline.
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/print.c b/src/print.c
index b2e5965cd1c..5b2778cf251 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1173,6 +1173,16 @@ print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
1173 print_object (obj, printcharfun, escapeflag); 1173 print_object (obj, printcharfun, escapeflag);
1174} 1174}
1175 1175
1176#define PRINT_CIRCLE_CANDIDATE_P(obj) \
1177 (STRINGP (obj) || CONSP (obj) \
1178 || (VECTORLIKEP (obj) \
1179 && (VECTORP (obj) || COMPILEDP (obj) \
1180 || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) \
1181 || HASH_TABLE_P (obj) || FONTP (obj))) \
1182 || (! NILP (Vprint_gensym) \
1183 && SYMBOLP (obj) \
1184 && !SYMBOL_INTERNED_P (obj)))
1185
1176/* Construct Vprint_number_table according to the structure of OBJ. 1186/* Construct Vprint_number_table according to the structure of OBJ.
1177 OBJ itself and all its elements will be added to Vprint_number_table 1187 OBJ itself and all its elements will be added to Vprint_number_table
1178 recursively if it is a list, vector, compiled function, char-table, 1188 recursively if it is a list, vector, compiled function, char-table,
@@ -1207,12 +1217,7 @@ print_preprocess (Lisp_Object obj)
1207 halftail = obj; 1217 halftail = obj;
1208 1218
1209 loop: 1219 loop:
1210 if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) 1220 if (PRINT_CIRCLE_CANDIDATE_P (obj))
1211 || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
1212 || HASH_TABLE_P (obj)
1213 || (! NILP (Vprint_gensym)
1214 && SYMBOLP (obj)
1215 && !SYMBOL_INTERNED_P (obj)))
1216 { 1221 {
1217 if (!HASH_TABLE_P (Vprint_number_table)) 1222 if (!HASH_TABLE_P (Vprint_number_table))
1218 { 1223 {
@@ -1389,12 +1394,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1389 error ("Apparently circular structure being printed"); 1394 error ("Apparently circular structure being printed");
1390 1395
1391 /* Detect circularities and truncate them. */ 1396 /* Detect circularities and truncate them. */
1392 if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) 1397 if (PRINT_CIRCLE_CANDIDATE_P (obj))
1393 || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
1394 || HASH_TABLE_P (obj)
1395 || (! NILP (Vprint_gensym)
1396 && SYMBOLP (obj)
1397 && !SYMBOL_INTERNED_P (obj)))
1398 { 1398 {
1399 if (NILP (Vprint_circle) && NILP (Vprint_gensym)) 1399 if (NILP (Vprint_circle) && NILP (Vprint_gensym))
1400 { 1400 {