diff options
| author | Kenichi Handa | 2006-02-07 01:19:06 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2006-02-07 01:19:06 +0000 |
| commit | d2b4c17d26022daf1a2b3f6ca4f727a23711622d (patch) | |
| tree | ef078da1a764d4e24faf26b2dc6b92ed99f668dd | |
| parent | ea37fbb817c487fea0ca3691df0b9ae70e86d5be (diff) | |
| download | emacs-d2b4c17d26022daf1a2b3f6ca4f727a23711622d.tar.gz emacs-d2b4c17d26022daf1a2b3f6ca4f727a23711622d.zip | |
(append_glyph): Refer to it->char_to_display instead of
it->c.
(produce_glyphs): Set the character to print in
it->char_to_display. Handle
unibyte-display-via-language-environment.
(produce_stretch_glyph): Set the character to print in
it->char_to_display.
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/term.c | 53 |
2 files changed, 44 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6c34fd28ad7..61e545da181 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2006-02-07 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * term.c (append_glyph): Refer to it->char_to_display instead of | ||
| 4 | it->c. | ||
| 5 | (produce_glyphs): Set the character to print in | ||
| 6 | it->char_to_display. Handle | ||
| 7 | unibyte-display-via-language-environment. | ||
| 8 | (produce_stretch_glyph): Set the character to print in | ||
| 9 | it->char_to_display. | ||
| 10 | |||
| 1 | 2006-02-06 Kenichi Handa <handa@m17n.org> | 11 | 2006-02-06 Kenichi Handa <handa@m17n.org> |
| 2 | 12 | ||
| 3 | * lread.c (openp): Initialized encoded_fn before GCPRO it. | 13 | * lread.c (openp): Initialized encoded_fn before GCPRO it. |
diff --git a/src/term.c b/src/term.c index 8c6250c522e..2b44653b961 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1634,10 +1634,10 @@ static void produce_stretch_glyph P_ ((struct it *)); | |||
| 1634 | 1634 | ||
| 1635 | 1635 | ||
| 1636 | /* Append glyphs to IT's glyph_row. Called from produce_glyphs for | 1636 | /* Append glyphs to IT's glyph_row. Called from produce_glyphs for |
| 1637 | terminal frames if IT->glyph_row != NULL. IT->c is the character | 1637 | terminal frames if IT->glyph_row != NULL. IT->char_to_display is |
| 1638 | for which to produce glyphs; IT->face_id contains the character's | 1638 | the character for which to produce glyphs; IT->face_id contains the |
| 1639 | face. Padding glyphs are appended if IT->c has a IT->pixel_width > | 1639 | character's face. Padding glyphs are appended if IT->c has a |
| 1640 | 1. */ | 1640 | IT->pixel_width > 1. */ |
| 1641 | 1641 | ||
| 1642 | static void | 1642 | static void |
| 1643 | append_glyph (it) | 1643 | append_glyph (it) |
| @@ -1657,7 +1657,7 @@ append_glyph (it) | |||
| 1657 | { | 1657 | { |
| 1658 | glyph->type = CHAR_GLYPH; | 1658 | glyph->type = CHAR_GLYPH; |
| 1659 | glyph->pixel_width = 1; | 1659 | glyph->pixel_width = 1; |
| 1660 | glyph->u.ch = it->c; | 1660 | glyph->u.ch = it->char_to_display; |
| 1661 | glyph->face_id = it->face_id; | 1661 | glyph->face_id = it->face_id; |
| 1662 | glyph->padding_p = i > 0; | 1662 | glyph->padding_p = i > 0; |
| 1663 | glyph->charpos = CHARPOS (it->position); | 1663 | glyph->charpos = CHARPOS (it->position); |
| @@ -1708,6 +1708,9 @@ produce_glyphs (it) | |||
| 1708 | xassert (it->what == IT_CHARACTER | 1708 | xassert (it->what == IT_CHARACTER |
| 1709 | || it->what == IT_COMPOSITION); | 1709 | || it->what == IT_COMPOSITION); |
| 1710 | 1710 | ||
| 1711 | /* Maybe translate single-byte characters to multibyte. */ | ||
| 1712 | it->char_to_display = it->c; | ||
| 1713 | |||
| 1711 | if (it->c >= 040 && it->c < 0177) | 1714 | if (it->c >= 040 && it->c < 0177) |
| 1712 | { | 1715 | { |
| 1713 | it->pixel_width = it->nglyphs = 1; | 1716 | it->pixel_width = it->nglyphs = 1; |
| @@ -1737,13 +1740,11 @@ produce_glyphs (it) | |||
| 1737 | { | 1740 | { |
| 1738 | int n = nspaces; | 1741 | int n = nspaces; |
| 1739 | 1742 | ||
| 1740 | it->c = ' '; | 1743 | it->char_to_display = ' '; |
| 1741 | it->pixel_width = it->len = 1; | 1744 | it->pixel_width = it->len = 1; |
| 1742 | 1745 | ||
| 1743 | while (n--) | 1746 | while (n--) |
| 1744 | append_glyph (it); | 1747 | append_glyph (it); |
| 1745 | |||
| 1746 | it->c = '\t'; | ||
| 1747 | } | 1748 | } |
| 1748 | 1749 | ||
| 1749 | it->pixel_width = nspaces; | 1750 | it->pixel_width = nspaces; |
| @@ -1751,14 +1752,30 @@ produce_glyphs (it) | |||
| 1751 | } | 1752 | } |
| 1752 | else if (SINGLE_BYTE_CHAR_P (it->c)) | 1753 | else if (SINGLE_BYTE_CHAR_P (it->c)) |
| 1753 | { | 1754 | { |
| 1754 | /* Coming here means that it->c is from display table, thus we | 1755 | if (unibyte_display_via_language_environment |
| 1755 | must send the code as is to the terminal. Although there's | 1756 | && (it->c >= 0240 |
| 1756 | no way to know how many columns it occupies on a screen, it | 1757 | || !NILP (Vnonascii_translation_table))) |
| 1757 | is a good assumption that a single byte code has 1-column | 1758 | { |
| 1758 | width. */ | 1759 | int charset; |
| 1759 | it->pixel_width = it->nglyphs = 1; | 1760 | |
| 1760 | if (it->glyph_row) | 1761 | it->char_to_display = unibyte_char_to_multibyte (it->c); |
| 1761 | append_glyph (it); | 1762 | charset = CHAR_CHARSET (it->char_to_display); |
| 1763 | it->pixel_width = CHARSET_WIDTH (charset); | ||
| 1764 | it->nglyphs = it->pixel_width; | ||
| 1765 | if (it->glyph_row) | ||
| 1766 | append_glyph (it); | ||
| 1767 | } | ||
| 1768 | else | ||
| 1769 | { | ||
| 1770 | /* Coming here means that it->c is from display table, thus we | ||
| 1771 | must send the code as is to the terminal. Although there's | ||
| 1772 | no way to know how many columns it occupies on a screen, it | ||
| 1773 | is a good assumption that a single byte code has 1-column | ||
| 1774 | width. */ | ||
| 1775 | it->pixel_width = it->nglyphs = 1; | ||
| 1776 | if (it->glyph_row) | ||
| 1777 | append_glyph (it); | ||
| 1778 | } | ||
| 1762 | } | 1779 | } |
| 1763 | else | 1780 | else |
| 1764 | { | 1781 | { |
| @@ -1843,17 +1860,15 @@ produce_stretch_glyph (it) | |||
| 1843 | Lisp_Object o_object = it->object; | 1860 | Lisp_Object o_object = it->object; |
| 1844 | Lisp_Object object = it->stack[it->sp - 1].string; | 1861 | Lisp_Object object = it->stack[it->sp - 1].string; |
| 1845 | int n = width; | 1862 | int n = width; |
| 1846 | int c = it->c; | ||
| 1847 | 1863 | ||
| 1848 | if (!STRINGP (object)) | 1864 | if (!STRINGP (object)) |
| 1849 | object = it->w->buffer; | 1865 | object = it->w->buffer; |
| 1850 | it->object = object; | 1866 | it->object = object; |
| 1851 | it->c = ' '; | 1867 | it->char_to_display = ' '; |
| 1852 | it->pixel_width = it->len = 1; | 1868 | it->pixel_width = it->len = 1; |
| 1853 | while (n--) | 1869 | while (n--) |
| 1854 | append_glyph (it); | 1870 | append_glyph (it); |
| 1855 | it->object = o_object; | 1871 | it->object = o_object; |
| 1856 | it->c = c; | ||
| 1857 | } | 1872 | } |
| 1858 | it->pixel_width = width; | 1873 | it->pixel_width = width; |
| 1859 | it->nglyphs = width; | 1874 | it->nglyphs = width; |