From bd01620e014a5638cc9e157003778607046a0562 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 15 Sep 2011 19:22:58 +0300 Subject: [PATCH] Add comments about special meaning of TAB characters in compositions. src/xterm.c (x_draw_composite_glyph_string_foreground): src/w32term.c (x_draw_composite_glyph_string_foreground): src/term.c (encode_terminal_code): src/composite.c (composition_update_it, get_composition_id): src/xdisp.c (get_next_display_element) (fill_composite_glyph_string): Add comments about special meaning of TAB characters in a composition. --- src/ChangeLog | 10 ++++++++++ src/composite.c | 4 ++++ src/term.c | 2 ++ src/w32term.c | 2 ++ src/xterm.c | 2 ++ 5 files changed, 20 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 895e3e587b3..22f69d4a9bb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-09-15 Eli Zaretskii + + * xterm.c (x_draw_composite_glyph_string_foreground): + * w32term.c (x_draw_composite_glyph_string_foreground): + * term.c (encode_terminal_code): + * composite.c (composition_update_it, get_composition_id): + * xdisp.c (get_next_display_element) + (fill_composite_glyph_string): Add comments about special meaning + of TAB characters in a composition. + 2011-09-15 Paul Eggert * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514). diff --git a/src/composite.c b/src/composite.c index 2a3fbe29552..c8e4dd082ae 100644 --- a/src/composite.c +++ b/src/composite.c @@ -345,6 +345,8 @@ get_composition_id (EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT nchars, { int this_width; ch = XINT (key_contents[i]); + /* TAB in a composition means display glyphs with padding + space on the left or right. */ this_width = (ch == '\t' ? 1 : CHAR_WIDTH (ch)); if (cmp->width < this_width) cmp->width = this_width; @@ -1384,6 +1386,8 @@ composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I else { for (i = 0; i < cmp->glyph_len; i++) + /* TAB in a composition means display glyphs with padding + space on the left or right. */ if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t') break; if (c == '\t') diff --git a/src/term.c b/src/term.c index 10416090b80..4a671d048c4 100644 --- a/src/term.c +++ b/src/term.c @@ -574,6 +574,8 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi { int c = COMPOSITION_GLYPH (cmp, i); + /* TAB in a composition means display glyphs with + padding space on the left or right. */ if (c == '\t') continue; if (char_charset (c, charset_list, NULL)) diff --git a/src/w32term.c b/src/w32term.c index 8d9d8f72029..39f1e245e18 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1294,6 +1294,8 @@ x_draw_composite_glyph_string_foreground (struct glyph_string *s) old_font = SelectObject (s->hdc, FONT_HANDLE (font)); for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++) + /* TAB in a composition means display glyphs with padding + space on the left or right. */ if (COMPOSITION_GLYPH (s->cmp, j) != '\t') { int xx = x + s->cmp->offsets[j * 2]; diff --git a/src/xterm.c b/src/xterm.c index 7c4ee96deab..4d3b572ade9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1306,6 +1306,8 @@ x_draw_composite_glyph_string_foreground (struct glyph_string *s) int y = s->ybase; for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++) + /* TAB in a composition means display glyphs with padding + space on the left or right. */ if (COMPOSITION_GLYPH (s->cmp, j) != '\t') { int xx = x + s->cmp->offsets[j * 2]; -- 2.39.2