aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorKenichi Handa2010-09-02 11:00:18 +0900
committerKenichi Handa2010-09-02 11:00:18 +0900
commit56524ce00eaf104b1f59288ef219c8edb4ef311d (patch)
treeac35fd89c65a2d2cf1e3ae8b9792e49dbd047b29 /src/term.c
parentae682ff5aeacc6e99a76d567b487cd2fa0d9a4a9 (diff)
parent2333c84afd9263abd5c71b4503435c5db1292f94 (diff)
downloademacs-56524ce00eaf104b1f59288ef219c8edb4ef311d.tar.gz
emacs-56524ce00eaf104b1f59288ef219c8edb4ef311d.zip
merge changes in emacs-23 branch
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/src/term.c b/src/term.c
index d1279498060..f090cdd2792 100644
--- a/src/term.c
+++ b/src/term.c
@@ -689,7 +689,8 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi
689 encode_terminal_src_size); 689 encode_terminal_src_size);
690 buf = encode_terminal_src + nbytes; 690 buf = encode_terminal_src + nbytes;
691 } 691 }
692 if (char_charset (c, charset_list, NULL)) 692 if (CHAR_BYTE8_P (c)
693 || char_charset (c, charset_list, NULL))
693 { 694 {
694 /* Store the multibyte form of C at BUF. */ 695 /* Store the multibyte form of C at BUF. */
695 buf += CHAR_STRING (c, buf); 696 buf += CHAR_STRING (c, buf);
@@ -1614,18 +1615,15 @@ produce_glyphs (struct it *it)
1614 goto done; 1615 goto done;
1615 } 1616 }
1616 1617
1617 /* Maybe translate single-byte characters to multibyte. */ 1618 if (it->char_to_display >= 040 && it->char_to_display < 0177)
1618 it->char_to_display = it->c;
1619
1620 if (it->c >= 040 && it->c < 0177)
1621 { 1619 {
1622 it->pixel_width = it->nglyphs = 1; 1620 it->pixel_width = it->nglyphs = 1;
1623 if (it->glyph_row) 1621 if (it->glyph_row)
1624 append_glyph (it); 1622 append_glyph (it);
1625 } 1623 }
1626 else if (it->c == '\n') 1624 else if (it->char_to_display == '\n')
1627 it->pixel_width = it->nglyphs = 0; 1625 it->pixel_width = it->nglyphs = 0;
1628 else if (it->c == '\t') 1626 else if (it->char_to_display == '\t')
1629 { 1627 {
1630 int absolute_x = (it->current_x 1628 int absolute_x = (it->current_x
1631 + it->continuation_lines_width); 1629 + it->continuation_lines_width);
@@ -1656,32 +1654,19 @@ produce_glyphs (struct it *it)
1656 it->pixel_width = nspaces; 1654 it->pixel_width = nspaces;
1657 it->nglyphs = nspaces; 1655 it->nglyphs = nspaces;
1658 } 1656 }
1659 else if (CHAR_BYTE8_P (it->c)) 1657 else if (CHAR_BYTE8_P (it->char_to_display))
1660 { 1658 {
1661 if (unibyte_display_via_language_environment 1659 /* Coming here means that we must send the raw 8-bit byte as is
1662 && (it->c >= 0240)) 1660 to the terminal. Although there's no way to know how many
1663 { 1661 columns it occupies on a screen, it is a good assumption that
1664 it->char_to_display = BYTE8_TO_CHAR (it->c); 1662 a single byte code has 1-column width. */
1665 it->pixel_width = CHAR_WIDTH (it->char_to_display); 1663 it->pixel_width = it->nglyphs = 1;
1666 it->nglyphs = it->pixel_width; 1664 if (it->glyph_row)
1667 if (it->glyph_row) 1665 append_glyph (it);
1668 append_glyph (it);
1669 }
1670 else
1671 {
1672 /* Coming here means that it->c is from display table, thus
1673 we must send the raw 8-bit byte as is to the terminal.
1674 Although there's no way to know how many columns it
1675 occupies on a screen, it is a good assumption that a
1676 single byte code has 1-column width. */
1677 it->pixel_width = it->nglyphs = 1;
1678 if (it->glyph_row)
1679 append_glyph (it);
1680 }
1681 } 1666 }
1682 else 1667 else
1683 { 1668 {
1684 it->pixel_width = CHAR_WIDTH (it->c); 1669 it->pixel_width = CHAR_WIDTH (it->char_to_display);
1685 it->nglyphs = it->pixel_width; 1670 it->nglyphs = it->pixel_width;
1686 1671
1687 if (it->glyph_row) 1672 if (it->glyph_row)
@@ -1917,7 +1902,7 @@ produce_special_glyphs (struct it *it, enum display_element_type what)
1917 else 1902 else
1918 abort (); 1903 abort ();
1919 1904
1920 temp_it.c = GLYPH_CHAR (glyph); 1905 temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
1921 temp_it.face_id = GLYPH_FACE (glyph); 1906 temp_it.face_id = GLYPH_FACE (glyph);
1922 temp_it.len = CHAR_BYTES (temp_it.c); 1907 temp_it.len = CHAR_BYTES (temp_it.c);
1923 1908