diff options
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/print.c | 20 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 20469ca12e3..dd86df3ef62 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2007-08-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * print.c (new_backquote_output): Rename from old_backquote_output. | ||
| 4 | (print): Inverse its logic (according to its name) so as to match the | ||
| 5 | behavior of new_backquote_flag in lread.c. | ||
| 6 | |||
| 1 | 2007-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 7 | 2007-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 8 | ||
| 3 | * gmalloc.c (posix_memalign): New function. | 9 | * gmalloc.c (posix_memalign): New function. |
diff --git a/src/print.c b/src/print.c index f7060024f32..cae80d1acfe 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -93,8 +93,8 @@ Lisp_Object Vfloat_output_format, Qfloat_output_format; | |||
| 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 |
| @@ -1291,7 +1291,7 @@ print (obj, printcharfun, escapeflag) | |||
| 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, |
| @@ -1756,14 +1756,24 @@ print_object (obj, printcharfun, escapeflag) | |||
| 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 | { |
| @@ -1783,9 +1793,7 @@ print_object (obj, printcharfun, escapeflag) | |||
| 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); |