]> git.eshelyaron.com Git - emacs.git/commitdiff
* print.c (print_object): Adjust to match new layout of sub char-table
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 2 Jul 2014 14:00:41 +0000 (18:00 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Wed, 2 Jul 2014 14:00:41 +0000 (18:00 +0400)
(Bug#17898).

src/ChangeLog
src/print.c

index 3df37a69527e4b045ecf1dc6a61f7ee714fda0ee..059164771408572f09c85a30e54f081a2e2238da 100644 (file)
@@ -15,6 +15,7 @@
        (map_sub_char_table_for_charset, uniprop_table_uncompress):
        All related users changed.
        * lread.c (read1): Adjust to match new layout of sub char-table.
+       * print.c (print_object): Likewise (Bug#17898).
 
 2014-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
index 9b3620765a8214116e89059808eb07f68bf26ab7..2f52f5d03ecb08f3697b4fc31640e667c6228ea9 100644 (file)
@@ -1981,16 +1981,24 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
 
          PRINTCHAR ('[');
          {
-           register int i;
+           int i, idx = SUB_CHAR_TABLE_P (obj) ? SUB_CHAR_TABLE_OFFSET : 0;
            register Lisp_Object tem;
            ptrdiff_t real_size = size;
 
+           /* For a sub char-table, print heading non-Lisp data first.  */
+           if (SUB_CHAR_TABLE_P (obj))
+             {
+               i = sprintf (buf, "%d %d", XSUB_CHAR_TABLE (obj)->depth,
+                            XSUB_CHAR_TABLE (obj)->min_char);
+               strout (buf, i, i, printcharfun);
+             }
+
            /* Don't print more elements than the specified maximum.  */
            if (NATNUMP (Vprint_length)
                && XFASTINT (Vprint_length) < size)
              size = XFASTINT (Vprint_length);
 
-           for (i = 0; i < size; i++)
+           for (i = idx; i < size; i++)
              {
                if (i) PRINTCHAR (' ');
                tem = AREF (obj, i);