diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/xdisp.c | 65 |
2 files changed, 52 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8fc876e248c..c0c85c15ee9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-01-05 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead | ||
| 4 | of a non-portable "t" to print ptrdiff_t values. Allow up to 9 | ||
| 5 | digits for buffer positions, before misalignment starts. Display | ||
| 6 | "0" for integer "object" field. | ||
| 7 | (dump_glyph_row): Adapt the header line to changes in dump_glyph. | ||
| 8 | Display the newline glyph more unambiguously. | ||
| 9 | |||
| 1 | 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 10 | 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 11 | ||
| 3 | * nsterm.m (ns_draw_underwave): | 12 | * nsterm.m (ns_draw_underwave): |
diff --git a/src/xdisp.c b/src/xdisp.c index 8b0d8b6cfa0..b75362b1446 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -17925,18 +17925,23 @@ dump_glyph_matrix (struct glyph_matrix *matrix, int glyphs) | |||
| 17925 | void | 17925 | void |
| 17926 | dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | 17926 | dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) |
| 17927 | { | 17927 | { |
| 17928 | if (glyph->type == CHAR_GLYPH) | 17928 | if (glyph->type == CHAR_GLYPH |
| 17929 | || glyph->type == GLYPHLESS_GLYPH) | ||
| 17929 | { | 17930 | { |
| 17930 | fprintf (stderr, | 17931 | fprintf (stderr, |
| 17931 | " %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n", | 17932 | " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n", |
| 17932 | glyph - row->glyphs[TEXT_AREA], | 17933 | glyph - row->glyphs[TEXT_AREA], |
| 17933 | 'C', | 17934 | (glyph->type == CHAR_GLYPH |
| 17935 | ? 'C' | ||
| 17936 | : 'G'), | ||
| 17934 | glyph->charpos, | 17937 | glyph->charpos, |
| 17935 | (BUFFERP (glyph->object) | 17938 | (BUFFERP (glyph->object) |
| 17936 | ? 'B' | 17939 | ? 'B' |
| 17937 | : (STRINGP (glyph->object) | 17940 | : (STRINGP (glyph->object) |
| 17938 | ? 'S' | 17941 | ? 'S' |
| 17939 | : '-')), | 17942 | : (INTEGERP (glyph->object) |
| 17943 | ? '0' | ||
| 17944 | : '-'))), | ||
| 17940 | glyph->pixel_width, | 17945 | glyph->pixel_width, |
| 17941 | glyph->u.ch, | 17946 | glyph->u.ch, |
| 17942 | (glyph->u.ch < 0x80 && glyph->u.ch >= ' ' | 17947 | (glyph->u.ch < 0x80 && glyph->u.ch >= ' ' |
| @@ -17949,7 +17954,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 17949 | else if (glyph->type == STRETCH_GLYPH) | 17954 | else if (glyph->type == STRETCH_GLYPH) |
| 17950 | { | 17955 | { |
| 17951 | fprintf (stderr, | 17956 | fprintf (stderr, |
| 17952 | " %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n", | 17957 | " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n", |
| 17953 | glyph - row->glyphs[TEXT_AREA], | 17958 | glyph - row->glyphs[TEXT_AREA], |
| 17954 | 'S', | 17959 | 'S', |
| 17955 | glyph->charpos, | 17960 | glyph->charpos, |
| @@ -17957,10 +17962,12 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 17957 | ? 'B' | 17962 | ? 'B' |
| 17958 | : (STRINGP (glyph->object) | 17963 | : (STRINGP (glyph->object) |
| 17959 | ? 'S' | 17964 | ? 'S' |
| 17960 | : '-')), | 17965 | : (INTEGERP (glyph->object) |
| 17966 | ? '0' | ||
| 17967 | : '-'))), | ||
| 17961 | glyph->pixel_width, | 17968 | glyph->pixel_width, |
| 17962 | 0, | 17969 | 0, |
| 17963 | '.', | 17970 | ' ', |
| 17964 | glyph->face_id, | 17971 | glyph->face_id, |
| 17965 | glyph->left_box_line_p, | 17972 | glyph->left_box_line_p, |
| 17966 | glyph->right_box_line_p); | 17973 | glyph->right_box_line_p); |
| @@ -17968,7 +17975,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 17968 | else if (glyph->type == IMAGE_GLYPH) | 17975 | else if (glyph->type == IMAGE_GLYPH) |
| 17969 | { | 17976 | { |
| 17970 | fprintf (stderr, | 17977 | fprintf (stderr, |
| 17971 | " %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n", | 17978 | " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n", |
| 17972 | glyph - row->glyphs[TEXT_AREA], | 17979 | glyph - row->glyphs[TEXT_AREA], |
| 17973 | 'I', | 17980 | 'I', |
| 17974 | glyph->charpos, | 17981 | glyph->charpos, |
| @@ -17976,7 +17983,9 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 17976 | ? 'B' | 17983 | ? 'B' |
| 17977 | : (STRINGP (glyph->object) | 17984 | : (STRINGP (glyph->object) |
| 17978 | ? 'S' | 17985 | ? 'S' |
| 17979 | : '-')), | 17986 | : (INTEGERP (glyph->object) |
| 17987 | ? '0' | ||
| 17988 | : '-'))), | ||
| 17980 | glyph->pixel_width, | 17989 | glyph->pixel_width, |
| 17981 | glyph->u.img_id, | 17990 | glyph->u.img_id, |
| 17982 | '.', | 17991 | '.', |
| @@ -17987,7 +17996,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 17987 | else if (glyph->type == COMPOSITE_GLYPH) | 17996 | else if (glyph->type == COMPOSITE_GLYPH) |
| 17988 | { | 17997 | { |
| 17989 | fprintf (stderr, | 17998 | fprintf (stderr, |
| 17990 | " %5td %4c %6"pI"d %c %3d 0x%05x", | 17999 | " %5"pD"d %c %9"pI"d %c %3d 0x%06x", |
| 17991 | glyph - row->glyphs[TEXT_AREA], | 18000 | glyph - row->glyphs[TEXT_AREA], |
| 17992 | '+', | 18001 | '+', |
| 17993 | glyph->charpos, | 18002 | glyph->charpos, |
| @@ -17995,7 +18004,9 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 17995 | ? 'B' | 18004 | ? 'B' |
| 17996 | : (STRINGP (glyph->object) | 18005 | : (STRINGP (glyph->object) |
| 17997 | ? 'S' | 18006 | ? 'S' |
| 17998 | : '-')), | 18007 | : (INTEGERP (glyph->object) |
| 18008 | ? '0' | ||
| 18009 | : '-'))), | ||
| 17999 | glyph->pixel_width, | 18010 | glyph->pixel_width, |
| 18000 | glyph->u.cmp.id); | 18011 | glyph->u.cmp.id); |
| 18001 | if (glyph->u.cmp.automatic) | 18012 | if (glyph->u.cmp.automatic) |
| @@ -18020,10 +18031,10 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs) | |||
| 18020 | { | 18031 | { |
| 18021 | if (glyphs != 1) | 18032 | if (glyphs != 1) |
| 18022 | { | 18033 | { |
| 18023 | fprintf (stderr, "Row Start End Used oE><\\CTZFesm X Y W H V A P\n"); | 18034 | fprintf (stderr, "Row Start End Used oE><\\CTZFesm X Y W H V A P\n"); |
| 18024 | fprintf (stderr, "======================================================================\n"); | 18035 | fprintf (stderr, "==============================================================================\n"); |
| 18025 | 18036 | ||
| 18026 | fprintf (stderr, "%3d %5"pI"d %5"pI"d %4d %1.1d%1.1d%1.1d%1.1d\ | 18037 | fprintf (stderr, "%3d %9"pI"d %9"pI"d %4d %1.1d%1.1d%1.1d%1.1d\ |
| 18027 | %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n", | 18038 | %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n", |
| 18028 | vpos, | 18039 | vpos, |
| 18029 | MATRIX_ROW_START_CHARPOS (row), | 18040 | MATRIX_ROW_START_CHARPOS (row), |
| @@ -18048,13 +18059,14 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs) | |||
| 18048 | row->visible_height, | 18059 | row->visible_height, |
| 18049 | row->ascent, | 18060 | row->ascent, |
| 18050 | row->phys_ascent); | 18061 | row->phys_ascent); |
| 18051 | fprintf (stderr, "%9"pD"d %5"pD"d\t%5d\n", row->start.overlay_string_index, | 18062 | /* The next 3 lines should align to "Start" in the header. */ |
| 18063 | fprintf (stderr, " %9"pD"d %9"pD"d\t%5d\n", row->start.overlay_string_index, | ||
| 18052 | row->end.overlay_string_index, | 18064 | row->end.overlay_string_index, |
| 18053 | row->continuation_lines_width); | 18065 | row->continuation_lines_width); |
| 18054 | fprintf (stderr, "%9"pI"d %5"pI"d\n", | 18066 | fprintf (stderr, " %9"pI"d %9"pI"d\n", |
| 18055 | CHARPOS (row->start.string_pos), | 18067 | CHARPOS (row->start.string_pos), |
| 18056 | CHARPOS (row->end.string_pos)); | 18068 | CHARPOS (row->end.string_pos)); |
| 18057 | fprintf (stderr, "%9d %5d\n", row->start.dpvec_index, | 18069 | fprintf (stderr, " %9d %9d\n", row->start.dpvec_index, |
| 18058 | row->end.dpvec_index); | 18070 | row->end.dpvec_index); |
| 18059 | } | 18071 | } |
| 18060 | 18072 | ||
| @@ -18072,7 +18084,7 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs) | |||
| 18072 | ++glyph_end; | 18084 | ++glyph_end; |
| 18073 | 18085 | ||
| 18074 | if (glyph < glyph_end) | 18086 | if (glyph < glyph_end) |
| 18075 | fprintf (stderr, " Glyph Type Pos O W Code C Face LR\n"); | 18087 | fprintf (stderr, " Glyph# Type Pos O W Code C Face LR\n"); |
| 18076 | 18088 | ||
| 18077 | for (; glyph < glyph_end; ++glyph) | 18089 | for (; glyph < glyph_end; ++glyph) |
| 18078 | dump_glyph (row, glyph, area); | 18090 | dump_glyph (row, glyph, area); |
| @@ -18084,15 +18096,24 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs) | |||
| 18084 | 18096 | ||
| 18085 | for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) | 18097 | for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) |
| 18086 | { | 18098 | { |
| 18087 | char *s = alloca (row->used[area] + 1); | 18099 | char *s = alloca (row->used[area] + 4); |
| 18088 | int i; | 18100 | int i; |
| 18089 | 18101 | ||
| 18090 | for (i = 0; i < row->used[area]; ++i) | 18102 | for (i = 0; i < row->used[area]; ++i) |
| 18091 | { | 18103 | { |
| 18092 | struct glyph *glyph = row->glyphs[area] + i; | 18104 | struct glyph *glyph = row->glyphs[area] + i; |
| 18093 | if (glyph->type == CHAR_GLYPH | 18105 | if (i == row->used[area] - 1 |
| 18094 | && glyph->u.ch < 0x80 | 18106 | && area == TEXT_AREA |
| 18095 | && glyph->u.ch >= ' ') | 18107 | && INTEGERP (glyph->object) |
| 18108 | && glyph->type == CHAR_GLYPH | ||
| 18109 | && glyph->u.ch == ' ') | ||
| 18110 | { | ||
| 18111 | strcpy (&s[i], "[\\n]"); | ||
| 18112 | i += 4; | ||
| 18113 | } | ||
| 18114 | else if (glyph->type == CHAR_GLYPH | ||
| 18115 | && glyph->u.ch < 0x80 | ||
| 18116 | && glyph->u.ch >= ' ') | ||
| 18096 | s[i] = glyph->u.ch; | 18117 | s[i] = glyph->u.ch; |
| 18097 | else | 18118 | else |
| 18098 | s[i] = '.'; | 18119 | s[i] = '.'; |