diff options
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/src/term.c b/src/term.c index 868b596dc1a..b67d93f5b5b 100644 --- a/src/term.c +++ b/src/term.c @@ -695,12 +695,8 @@ encode_terminal_code (src, src_len, coding) encode_terminal_src_size); buf = encode_terminal_src + nbytes; } - if (CHAR_BYTE8_P (c)) - { - *buf++ = CHAR_TO_BYTE8 (c); - nchars++; - } - else if (char_charset (c, charset_list, NULL)) + if (CHAR_BYTE8_P (c) + || char_charset (c, charset_list, NULL)) { /* Store the multibyte form of C at BUF. */ buf += CHAR_STRING (c, buf); @@ -1610,18 +1606,15 @@ produce_glyphs (it) goto done; } - /* Maybe translate single-byte characters to multibyte. */ - it->char_to_display = it->c; - - if (it->c >= 040 && it->c < 0177) + if (it->char_to_display >= 040 && it->char_to_display < 0177) { it->pixel_width = it->nglyphs = 1; if (it->glyph_row) append_glyph (it); } - else if (it->c == '\n') + else if (it->char_to_display == '\n') it->pixel_width = it->nglyphs = 0; - else if (it->c == '\t') + else if (it->char_to_display == '\t') { int absolute_x = (it->current_x + it->continuation_lines_width); @@ -1652,32 +1645,19 @@ produce_glyphs (it) it->pixel_width = nspaces; it->nglyphs = nspaces; } - else if (CHAR_BYTE8_P (it->c)) + else if (CHAR_BYTE8_P (it->char_to_display)) { - if (unibyte_display_via_language_environment - && (it->c >= 0240)) - { - it->char_to_display = BYTE8_TO_CHAR (it->c); - it->pixel_width = CHAR_WIDTH (it->char_to_display); - it->nglyphs = it->pixel_width; - if (it->glyph_row) - append_glyph (it); - } - else - { - /* Coming here means that it->c is from display table, thus - we must send the raw 8-bit byte as is to the terminal. - Although there's no way to know how many columns it - occupies on a screen, it is a good assumption that a - single byte code has 1-column width. */ - it->pixel_width = it->nglyphs = 1; - if (it->glyph_row) - append_glyph (it); - } + /* Coming here means that we must send the raw 8-bit byte as is + to the terminal. Although there's no way to know how many + columns it occupies on a screen, it is a good assumption that + a single byte code has 1-column width. */ + it->pixel_width = it->nglyphs = 1; + if (it->glyph_row) + append_glyph (it); } else { - it->pixel_width = CHAR_WIDTH (it->c); + it->pixel_width = CHAR_WIDTH (it->char_to_display); it->nglyphs = it->pixel_width; if (it->glyph_row) @@ -1892,7 +1872,7 @@ produce_special_glyphs (it, what) else abort (); - temp_it.c = GLYPH_CHAR (glyph); + temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph); temp_it.face_id = GLYPH_FACE (glyph); temp_it.len = CHAR_BYTES (temp_it.c); |