aboutsummaryrefslogtreecommitdiffstats
path: root/src/print.c
diff options
context:
space:
mode:
authorStefan Monnier2011-03-21 12:42:16 -0400
committerStefan Monnier2011-03-21 12:42:16 -0400
commitcafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch)
tree7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/print.c
parenta08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff)
parent4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff)
downloademacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz
emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip
Merge from trunk
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c26
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. */)
801 { 801 {
802 file = Fexpand_file_name (file, Qnil); 802 file = Fexpand_file_name (file, Qnil);
803 initial_stderr_stream = stderr; 803 initial_stderr_stream = stderr;
804 stderr = fopen (SDATA (file), NILP (append) ? "w" : "a"); 804 stderr = fopen (SSDATA (file), NILP (append) ? "w" : "a");
805 if (stderr == NULL) 805 if (stderr == NULL)
806 { 806 {
807 stderr = initial_stderr_stream; 807 stderr = initial_stderr_stream;
@@ -1120,6 +1120,16 @@ print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
1120 print_object (obj, printcharfun, escapeflag); 1120 print_object (obj, printcharfun, escapeflag);
1121} 1121}
1122 1122
1123#define PRINT_CIRCLE_CANDIDATE_P(obj) \
1124 (STRINGP (obj) || CONSP (obj) \
1125 || (VECTORLIKEP (obj) \
1126 && (VECTORP (obj) || COMPILEDP (obj) \
1127 || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) \
1128 || HASH_TABLE_P (obj) || FONTP (obj))) \
1129 || (! NILP (Vprint_gensym) \
1130 && SYMBOLP (obj) \
1131 && !SYMBOL_INTERNED_P (obj)))
1132
1123/* Construct Vprint_number_table according to the structure of OBJ. 1133/* Construct Vprint_number_table according to the structure of OBJ.
1124 OBJ itself and all its elements will be added to Vprint_number_table 1134 OBJ itself and all its elements will be added to Vprint_number_table
1125 recursively if it is a list, vector, compiled function, char-table, 1135 recursively if it is a list, vector, compiled function, char-table,
@@ -1154,12 +1164,7 @@ print_preprocess (Lisp_Object obj)
1154 halftail = obj; 1164 halftail = obj;
1155 1165
1156 loop: 1166 loop:
1157 if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) 1167 if (PRINT_CIRCLE_CANDIDATE_P (obj))
1158 || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
1159 || HASH_TABLE_P (obj)
1160 || (! NILP (Vprint_gensym)
1161 && SYMBOLP (obj)
1162 && !SYMBOL_INTERNED_P (obj)))
1163 { 1168 {
1164 if (!HASH_TABLE_P (Vprint_number_table)) 1169 if (!HASH_TABLE_P (Vprint_number_table))
1165 { 1170 {
@@ -1336,12 +1341,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1336 error ("Apparently circular structure being printed"); 1341 error ("Apparently circular structure being printed");
1337 1342
1338 /* Detect circularities and truncate them. */ 1343 /* Detect circularities and truncate them. */
1339 if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) 1344 if (PRINT_CIRCLE_CANDIDATE_P (obj))
1340 || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
1341 || HASH_TABLE_P (obj)
1342 || (! NILP (Vprint_gensym)
1343 && SYMBOLP (obj)
1344 && !SYMBOL_INTERNED_P (obj)))
1345 { 1345 {
1346 if (NILP (Vprint_circle) && NILP (Vprint_gensym)) 1346 if (NILP (Vprint_circle) && NILP (Vprint_gensym))
1347 { 1347 {