emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r111137: Improve display of glyph


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111137: Improve display of glyph matrix by dump-glyph-matrix.
Date: Sat, 05 Jan 2013 15:37:36 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111137
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Sat 2013-01-05 15:37:36 +0200
message:
  Improve display of glyph matrix by dump-glyph-matrix.
  
   src/xdisp.c (dump_glyph): Align glyph data better.  Use "pD" instead
   of a non-portable "t" to print ptrdiff_t values.  Allow up to 9
   digits for buffer positions, before misalignment starts.  Display
   "0" for integer "object" field.
   (dump_glyph_row): Adapt the header line to changes in dump_glyph.
   Display the newline glyph more unambiguously.
modified:
  src/ChangeLog
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-01-04 02:05:33 +0000
+++ b/src/ChangeLog     2013-01-05 13:37:36 +0000
@@ -1,3 +1,12 @@
+2013-01-05  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (dump_glyph): Align glyph data better.  Use "pD" instead
+       of a non-portable "t" to print ptrdiff_t values.  Allow up to 9
+       digits for buffer positions, before misalignment starts.  Display
+       "0" for integer "object" field.
+       (dump_glyph_row): Adapt the header line to changes in dump_glyph.
+       Display the newline glyph more unambiguously.
+
 2013-01-04  YAMAMOTO Mitsuharu  <address@hidden>
 
        * nsterm.m (ns_draw_underwave):

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2013-01-01 09:11:05 +0000
+++ b/src/xdisp.c       2013-01-05 13:37:36 +0000
@@ -17978,18 +17978,23 @@
 void
 dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
 {
-  if (glyph->type == CHAR_GLYPH)
+  if (glyph->type == CHAR_GLYPH
+      || glyph->type == GLYPHLESS_GLYPH)
     {
       fprintf (stderr,
-              "  %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
+              "  %5"pD"d     %c %9"pI"d   %c %3d 0x%06x      %c %4d 
%1.1d%1.1d\n",
               glyph - row->glyphs[TEXT_AREA],
-              'C',
+              (glyph->type == CHAR_GLYPH
+               ? 'C'
+               : 'G'),
               glyph->charpos,
               (BUFFERP (glyph->object)
                ? 'B'
                : (STRINGP (glyph->object)
                   ? 'S'
-                  : '-')),
+                  : (INTEGERP (glyph->object)
+                     ? '0'
+                     : '-'))),
               glyph->pixel_width,
               glyph->u.ch,
               (glyph->u.ch < 0x80 && glyph->u.ch >= ' '
@@ -18002,7 +18007,7 @@
   else if (glyph->type == STRETCH_GLYPH)
     {
       fprintf (stderr,
-              "  %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
+              "  %5"pD"d     %c %9"pI"d   %c %3d 0x%06x      %c %4d 
%1.1d%1.1d\n",
               glyph - row->glyphs[TEXT_AREA],
               'S',
               glyph->charpos,
@@ -18010,10 +18015,12 @@
                ? 'B'
                : (STRINGP (glyph->object)
                   ? 'S'
-                  : '-')),
+                  : (INTEGERP (glyph->object)
+                     ? '0'
+                     : '-'))),
               glyph->pixel_width,
               0,
-              '.',
+              ' ',
               glyph->face_id,
               glyph->left_box_line_p,
               glyph->right_box_line_p);
@@ -18021,7 +18028,7 @@
   else if (glyph->type == IMAGE_GLYPH)
     {
       fprintf (stderr,
-              "  %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
+              "  %5"pD"d     %c %9"pI"d   %c %3d 0x%06x      %c %4d 
%1.1d%1.1d\n",
               glyph - row->glyphs[TEXT_AREA],
               'I',
               glyph->charpos,
@@ -18029,7 +18036,9 @@
                ? 'B'
                : (STRINGP (glyph->object)
                   ? 'S'
-                  : '-')),
+                  : (INTEGERP (glyph->object)
+                     ? '0'
+                     : '-'))),
               glyph->pixel_width,
               glyph->u.img_id,
               '.',
@@ -18040,7 +18049,7 @@
   else if (glyph->type == COMPOSITE_GLYPH)
     {
       fprintf (stderr,
-              "  %5td %4c %6"pI"d %c %3d 0x%05x",
+              "  %5"pD"d     %c %9"pI"d   %c %3d 0x%06x",
               glyph - row->glyphs[TEXT_AREA],
               '+',
               glyph->charpos,
@@ -18048,7 +18057,9 @@
                ? 'B'
                : (STRINGP (glyph->object)
                   ? 'S'
-                  : '-')),
+                  : (INTEGERP (glyph->object)
+                     ? '0'
+                     : '-'))),
               glyph->pixel_width,
               glyph->u.cmp.id);
       if (glyph->u.cmp.automatic)
@@ -18073,10 +18084,10 @@
 {
   if (glyphs != 1)
     {
-      fprintf (stderr, "Row Start   End Used oE><\\CTZFesm     X    Y    W    
H    V    A    P\n");
-      fprintf (stderr, 
"======================================================================\n");
+      fprintf (stderr, "Row     Start       End Used oE><\\CTZFesm     X    Y  
  W    H    V    A    P\n");
+      fprintf (stderr, 
"==============================================================================\n");
 
-      fprintf (stderr, "%3d %5"pI"d %5"pI"d %4d %1.1d%1.1d%1.1d%1.1d\
+      fprintf (stderr, "%3d %9"pI"d %9"pI"d %4d %1.1d%1.1d%1.1d%1.1d\
 %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d  %4d %4d %4d %4d %4d %4d %4d\n",
               vpos,
               MATRIX_ROW_START_CHARPOS (row),
@@ -18101,13 +18112,14 @@
               row->visible_height,
               row->ascent,
               row->phys_ascent);
-      fprintf (stderr, "%9"pD"d %5"pD"d\t%5d\n", 
row->start.overlay_string_index,
+      /* The next 3 lines should align to "Start" in the header.  */
+      fprintf (stderr, "    %9"pD"d %9"pD"d\t%5d\n", 
row->start.overlay_string_index,
               row->end.overlay_string_index,
               row->continuation_lines_width);
-      fprintf (stderr, "%9"pI"d %5"pI"d\n",
+      fprintf (stderr, "    %9"pI"d %9"pI"d\n",
               CHARPOS (row->start.string_pos),
               CHARPOS (row->end.string_pos));
-      fprintf (stderr, "%9d %5d\n", row->start.dpvec_index,
+      fprintf (stderr, "    %9d %9d\n", row->start.dpvec_index,
               row->end.dpvec_index);
     }
 
@@ -18125,7 +18137,7 @@
            ++glyph_end;
 
          if (glyph < glyph_end)
-           fprintf (stderr, "  Glyph    Type Pos   O W    Code C Face LR\n");
+           fprintf (stderr, " Glyph#  Type       Pos   O   W     Code      C 
Face LR\n");
 
          for (; glyph < glyph_end; ++glyph)
            dump_glyph (row, glyph, area);
@@ -18137,15 +18149,24 @@
 
       for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
        {
-         char *s = alloca (row->used[area] + 1);
+         char *s = alloca (row->used[area] + 4);
          int i;
 
          for (i = 0; i < row->used[area]; ++i)
            {
              struct glyph *glyph = row->glyphs[area] + i;
-             if (glyph->type == CHAR_GLYPH
-                 && glyph->u.ch < 0x80
-                 && glyph->u.ch >= ' ')
+             if (i == row->used[area] - 1
+                 && area == TEXT_AREA
+                 && INTEGERP (glyph->object)
+                 && glyph->type == CHAR_GLYPH
+                 && glyph->u.ch == ' ')
+               {
+                 strcpy (&s[i], "[\\n]");
+                 i += 4;
+               }
+             else if (glyph->type == CHAR_GLYPH
+                      && glyph->u.ch < 0x80
+                      && glyph->u.ch >= ' ')
                s[i] = glyph->u.ch;
              else
                s[i] = '.';


reply via email to

[Prev in Thread] Current Thread [Next in Thread]