aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-03-16 13:34:26 -0400
committerStefan Monnier2011-03-16 13:34:26 -0400
commitfb103ca9a72ab9ddeeea1a9cfef85b0492ab9651 (patch)
treeff0c943647bd2a26436d2d4db6af133875f40585
parent35ac2a97f505a3c0de5cc2d4cf40b5b2f22529d0 (diff)
downloademacs-fb103ca9a72ab9ddeeea1a9cfef85b0492ab9651.tar.gz
emacs-fb103ca9a72ab9ddeeea1a9cfef85b0492ab9651.zip
* src/print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
(print_preprocess, print_object): New macro to fix last change.
-rw-r--r--src/ChangeLog3
-rw-r--r--src/print.c24
2 files changed, 15 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e25ed31f45b..c43d3ba95ec 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12011-03-16 Stefan Monnier <monnier@iro.umontreal.ca> 12011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
4 (print_preprocess, print_object): New macro to fix last change.
5
3 * print.c (print_preprocess): Don't forget font objects. 6 * print.c (print_preprocess): Don't forget font objects.
4 7
52011-03-16 Juanma Barranquero <lekktu@gmail.com> 82011-03-16 Juanma Barranquero <lekktu@gmail.com>
diff --git a/src/print.c b/src/print.c
index f48ba57b574..c7011642643 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) || FONTP (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 {