diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-16 13:34:26 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-16 13:34:26 -0400 |
commit | fb103ca9a72ab9ddeeea1a9cfef85b0492ab9651 (patch) | |
tree | ff0c943647bd2a26436d2d4db6af133875f40585 /src | |
parent | 35ac2a97f505a3c0de5cc2d4cf40b5b2f22529d0 (diff) | |
download | emacs-fb103ca9a72ab9ddeeea1a9cfef85b0492ab9651.tar.gz |
* src/print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
(print_preprocess, print_object): New macro to fix last change.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 3 | ||||
-rw-r--r-- | src/print.c | 24 |
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 @@ 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca> + * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro. + (print_preprocess, print_object): New macro to fix last change. + * print.c (print_preprocess): Don't forget font objects. 2011-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) print_object (obj, printcharfun, escapeflag); } +#define PRINT_CIRCLE_CANDIDATE_P(obj) \ + (STRINGP (obj) || CONSP (obj) \ + || (VECTORLIKEP (obj) \ + && (VECTORP (obj) || COMPILEDP (obj) \ + || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) \ + || HASH_TABLE_P (obj) || FONTP (obj))) \ + || (! NILP (Vprint_gensym) \ + && SYMBOLP (obj) \ + && !SYMBOL_INTERNED_P (obj))) + /* Construct Vprint_number_table according to the structure of OBJ. OBJ itself and all its elements will be added to Vprint_number_table recursively if it is a list, vector, compiled function, char-table, @@ -1207,12 +1217,7 @@ print_preprocess (Lisp_Object obj) halftail = obj; loop: - if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) - || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) - || HASH_TABLE_P (obj) || FONTP (obj) - || (! NILP (Vprint_gensym) - && SYMBOLP (obj) - && !SYMBOL_INTERNED_P (obj))) + if (PRINT_CIRCLE_CANDIDATE_P (obj)) { if (!HASH_TABLE_P (Vprint_number_table)) { @@ -1389,12 +1394,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag error ("Apparently circular structure being printed"); /* Detect circularities and truncate them. */ - if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) - || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) - || HASH_TABLE_P (obj) - || (! NILP (Vprint_gensym) - && SYMBOLP (obj) - && !SYMBOL_INTERNED_P (obj))) + if (PRINT_CIRCLE_CANDIDATE_P (obj)) { if (NILP (Vprint_circle) && NILP (Vprint_gensym)) { |