]> git.eshelyaron.com Git - emacs.git/commitdiff
(new_backquote_output): Rename from old_backquote_output.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 10 Aug 2007 08:01:30 +0000 (08:01 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 10 Aug 2007 08:01:30 +0000 (08:01 +0000)
(print): Inverse its logic (according to its name) so as to match the
behavior of new_backquote_flag in lread.c.

src/ChangeLog
src/print.c

index 20469ca12e318c77a343c3e91be7d3bbb4deb1be..dd86df3ef62d5c8fe631ebe376fdf7e92405cbe6 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * print.c (new_backquote_output): Rename from old_backquote_output.
+       (print): Inverse its logic (according to its name) so as to match the
+       behavior of new_backquote_flag in lread.c.
+
 2007-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * gmalloc.c (posix_memalign): New function.
index f7060024f32e5099c3e62a343bbc6be6261625e5..cae80d1acfe5c483ddaedcb93dfcf69316b6cacf 100644 (file)
@@ -93,8 +93,8 @@ Lisp_Object Vfloat_output_format, Qfloat_output_format;
 /* Avoid actual stack overflow in print.  */
 int print_depth;
 
-/* Nonzero if inside outputting backquote in old style.  */
-int old_backquote_output;
+/* Level of nesting inside outputting backquote in new style.  */
+int new_backquote_output;
 
 /* Detect most circularities to print finite output.  */
 #define PRINT_CIRCLE 200
@@ -1291,7 +1291,7 @@ print (obj, printcharfun, escapeflag)
      register Lisp_Object printcharfun;
      int escapeflag;
 {
-  old_backquote_output = 0;
+  new_backquote_output = 0;
 
   /* Reset print_number_index and Vprint_number_table only when
      the variable Vprint_continuous_numbering is nil.  Otherwise,
@@ -1756,14 +1756,24 @@ print_object (obj, printcharfun, escapeflag)
          print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
        }
       else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj)))
-              && ! old_backquote_output
+              && ((EQ (XCAR (obj), Qbackquote))))
+       {
+         print_object (XCAR (obj), printcharfun, 0);
+         new_backquote_output++;
+         print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
+         new_backquote_output--;
+       }
+      else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj)))
+              && new_backquote_output
               && ((EQ (XCAR (obj), Qbackquote)
                    || EQ (XCAR (obj), Qcomma)
                    || EQ (XCAR (obj), Qcomma_at)
                    || EQ (XCAR (obj), Qcomma_dot))))
        {
          print_object (XCAR (obj), printcharfun, 0);
+         new_backquote_output--;
          print_object (XCAR (XCDR (obj)), printcharfun, escapeflag);
+         new_backquote_output++;
        }
       else
        {
@@ -1783,9 +1793,7 @@ print_object (obj, printcharfun, escapeflag)
              print_object (Qbackquote, printcharfun, 0);
              PRINTCHAR (' ');
 
-             ++old_backquote_output;
              print_object (XCAR (XCDR (tem)), printcharfun, 0);
-             --old_backquote_output;
              PRINTCHAR (')');
 
              obj = XCDR (obj);