diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-21 12:42:16 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-21 12:42:16 -0400 |
commit | cafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch) | |
tree | 7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/print.c | |
parent | a08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff) | |
parent | 4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff) | |
download | emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.bz2 emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip |
Merge from trunk
Diffstat (limited to 'src/print.c')
-rw-r--r-- | src/print.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/print.c b/src/print.c index 602575b5b08..b8266422473 100644 --- a/src/print.c +++ b/src/print.c @@ -801,7 +801,7 @@ append to existing target file. */) { file = Fexpand_file_name (file, Qnil); initial_stderr_stream = stderr; - stderr = fopen (SDATA (file), NILP (append) ? "w" : "a"); + stderr = fopen (SSDATA (file), NILP (append) ? "w" : "a"); if (stderr == NULL) { stderr = initial_stderr_stream; @@ -1120,6 +1120,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, @@ -1154,12 +1164,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) - || (! NILP (Vprint_gensym) - && SYMBOLP (obj) - && !SYMBOL_INTERNED_P (obj))) + if (PRINT_CIRCLE_CANDIDATE_P (obj)) { if (!HASH_TABLE_P (Vprint_number_table)) { @@ -1336,12 +1341,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)) { |