comparison src/print.c @ 83652:5b644ae74c91

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 846-851) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 88-92) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 242-244) - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-31
author Miles Bader <miles@gnu.org>
date Mon, 13 Aug 2007 13:51:08 +0000
parents 65663fcd2caa 30f73a22d4ce
children 8ef41e809922
comparison
equal deleted inserted replaced
83651:47230f3f349b 83652:5b644ae74c91
91 #endif 91 #endif
92 92
93 /* Avoid actual stack overflow in print. */ 93 /* Avoid actual stack overflow in print. */
94 int print_depth; 94 int print_depth;
95 95
96 /* Nonzero if inside outputting backquote in old style. */ 96 /* Level of nesting inside outputting backquote in new style. */
97 int old_backquote_output; 97 int new_backquote_output;
98 98
99 /* Detect most circularities to print finite output. */ 99 /* Detect most circularities to print finite output. */
100 #define PRINT_CIRCLE 200 100 #define PRINT_CIRCLE 200
101 Lisp_Object being_printed[PRINT_CIRCLE]; 101 Lisp_Object being_printed[PRINT_CIRCLE];
102 102
1289 print (obj, printcharfun, escapeflag) 1289 print (obj, printcharfun, escapeflag)
1290 Lisp_Object obj; 1290 Lisp_Object obj;
1291 register Lisp_Object printcharfun; 1291 register Lisp_Object printcharfun;
1292 int escapeflag; 1292 int escapeflag;
1293 { 1293 {
1294 old_backquote_output = 0; 1294 new_backquote_output = 0;
1295 1295
1296 /* Reset print_number_index and Vprint_number_table only when 1296 /* Reset print_number_index and Vprint_number_table only when
1297 the variable Vprint_continuous_numbering is nil. Otherwise, 1297 the variable Vprint_continuous_numbering is nil. Otherwise,
1298 the values of these variables will be kept between several 1298 the values of these variables will be kept between several
1299 print functions. */ 1299 print functions. */
1754 PRINTCHAR ('#'); 1754 PRINTCHAR ('#');
1755 PRINTCHAR ('\''); 1755 PRINTCHAR ('\'');
1756 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag); 1756 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
1757 } 1757 }
1758 else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj))) 1758 else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj)))
1759 && ! old_backquote_output 1759 && ((EQ (XCAR (obj), Qbackquote))))
1760 {
1761 print_object (XCAR (obj), printcharfun, 0);
1762 new_backquote_output++;
1763 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
1764 new_backquote_output--;
1765 }
1766 else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj)))
1767 && new_backquote_output
1760 && ((EQ (XCAR (obj), Qbackquote) 1768 && ((EQ (XCAR (obj), Qbackquote)
1761 || EQ (XCAR (obj), Qcomma) 1769 || EQ (XCAR (obj), Qcomma)
1762 || EQ (XCAR (obj), Qcomma_at) 1770 || EQ (XCAR (obj), Qcomma_at)
1763 || EQ (XCAR (obj), Qcomma_dot)))) 1771 || EQ (XCAR (obj), Qcomma_dot))))
1764 { 1772 {
1765 print_object (XCAR (obj), printcharfun, 0); 1773 print_object (XCAR (obj), printcharfun, 0);
1774 new_backquote_output--;
1766 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag); 1775 print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
1776 new_backquote_output++;
1767 } 1777 }
1768 else 1778 else
1769 { 1779 {
1770 PRINTCHAR ('('); 1780 PRINTCHAR ('(');
1771 1781
1781 PRINTCHAR ('('); 1791 PRINTCHAR ('(');
1782 1792
1783 print_object (Qbackquote, printcharfun, 0); 1793 print_object (Qbackquote, printcharfun, 0);
1784 PRINTCHAR (' '); 1794 PRINTCHAR (' ');
1785 1795
1786 ++old_backquote_output;
1787 print_object (XCAR (XCDR (tem)), printcharfun, 0); 1796 print_object (XCAR (XCDR (tem)), printcharfun, 0);
1788 --old_backquote_output;
1789 PRINTCHAR (')'); 1797 PRINTCHAR (')');
1790 1798
1791 obj = XCDR (obj); 1799 obj = XCDR (obj);
1792 } 1800 }
1793 1801