diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 93 |
1 files changed, 43 insertions, 50 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 3983d26134e..86e776df608 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3353,8 +3353,6 @@ display_text_line (w, start, start_byte, vpos, hpos, taboffset, ovstr_done) | |||
| 3353 | 3353 | ||
| 3354 | while (p1 < endp) | 3354 | while (p1 < endp) |
| 3355 | { | 3355 | { |
| 3356 | int eat_following_binary_data; | ||
| 3357 | |||
| 3358 | if (pos >= pause) | 3356 | if (pos >= pause) |
| 3359 | { | 3357 | { |
| 3360 | int e_t_h; | 3358 | int e_t_h; |
| @@ -3739,61 +3737,56 @@ display_text_line (w, start, start_byte, vpos, hpos, taboffset, ovstr_done) | |||
| 3739 | *p1 = MAKE_GLYPH (f, c ^ 0100, current_face) | rev_dir_bit; | 3737 | *p1 = MAKE_GLYPH (f, c ^ 0100, current_face) | rev_dir_bit; |
| 3740 | p1++; | 3738 | p1++; |
| 3741 | } | 3739 | } |
| 3742 | else if (len == 1) | ||
| 3743 | { | ||
| 3744 | /* C is not a multibyte character. */ | ||
| 3745 | eat_following_binary_data = multibyte && BASE_LEADING_CODE_P (c); | ||
| 3746 | |||
| 3747 | label_display_binary_data: | ||
| 3748 | do { | ||
| 3749 | if (p1 >= leftmargin && p1 < endp) | ||
| 3750 | *p1 = (fix_glyph | ||
| 3751 | (f, (dp && INTEGERP (DISP_ESCAPE_GLYPH (dp)) | ||
| 3752 | && GLYPH_CHAR_VALID_P (XINT (DISP_ESCAPE_GLYPH (dp))) | ||
| 3753 | ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'), | ||
| 3754 | current_face) | ||
| 3755 | | rev_dir_bit); | ||
| 3756 | p1++; | ||
| 3757 | if (p1 >= leftmargin && p1 < endp) | ||
| 3758 | *p1 = MAKE_GLYPH (f, (c >> 6) + '0', current_face) | rev_dir_bit; | ||
| 3759 | p1++; | ||
| 3760 | if (p1 >= leftmargin && p1 < endp) | ||
| 3761 | *p1 = (MAKE_GLYPH (f, (7 & (c >> 3)) + '0', current_face) | ||
| 3762 | | rev_dir_bit); | ||
| 3763 | p1++; | ||
| 3764 | if (p1 >= leftmargin && p1 < endp) | ||
| 3765 | *p1 = MAKE_GLYPH (f, (7 & c) + '0', current_face) | rev_dir_bit; | ||
| 3766 | p1++; | ||
| 3767 | } while (eat_following_binary_data | ||
| 3768 | && (pos_byte + len) < limit_byte | ||
| 3769 | && ! CHAR_HEAD_P (*p) | ||
| 3770 | && ((c = *p++), len++)); | ||
| 3771 | } | ||
| 3772 | else | 3740 | else |
| 3773 | { | 3741 | { |
| 3774 | /* C is a multibyte character. */ | 3742 | /* C is a multibyte character or a character to be displayed |
| 3775 | int charset = CHAR_CHARSET (c); | 3743 | by octral form. */ |
| 3776 | int columns = (charset == CHARSET_COMPOSITION | 3744 | int remaining_bytes = len; |
| 3777 | ? cmpchar_table[COMPOSITE_CHAR_ID (c)]->width | ||
| 3778 | : CHARSET_WIDTH (charset)); | ||
| 3779 | GLYPH g = MAKE_GLYPH (f, c, current_face) | rev_dir_bit; | ||
| 3780 | 3745 | ||
| 3781 | while (columns--) | 3746 | if (c >= 0400) |
| 3782 | { | 3747 | { |
| 3783 | if (p1 >= leftmargin && p1 < endp) | 3748 | /* C is a multibyte character. */ |
| 3784 | *p1 = g, g |= GLYPH_MASK_PADDING; | 3749 | int charset = CHAR_CHARSET (c); |
| 3785 | p1++; | 3750 | int columns = (charset == CHARSET_COMPOSITION |
| 3751 | ? cmpchar_table[COMPOSITE_CHAR_ID (c)]->width | ||
| 3752 | : CHARSET_WIDTH (charset)); | ||
| 3753 | GLYPH g = MAKE_GLYPH (f, c, current_face) | rev_dir_bit; | ||
| 3754 | |||
| 3755 | while (columns--) | ||
| 3756 | { | ||
| 3757 | if (p1 >= leftmargin && p1 < endp) | ||
| 3758 | *p1 = g, g |= GLYPH_MASK_PADDING; | ||
| 3759 | p1++; | ||
| 3760 | } | ||
| 3761 | p1_wide_column_end = p1; | ||
| 3762 | remaining_bytes -= CHARSET_BYTES (charset); | ||
| 3786 | } | 3763 | } |
| 3787 | 3764 | ||
| 3788 | p1_wide_column_end = p1; | 3765 | while (remaining_bytes > 0) |
| 3789 | /* Check if binary data follows it. */ | ||
| 3790 | if (pos_byte + len < limit_byte | ||
| 3791 | && ! CHAR_HEAD_P (*p)) | ||
| 3792 | { | 3766 | { |
| 3793 | eat_following_binary_data = 1; | 3767 | c = *(p - remaining_bytes--); |
| 3794 | c = *p++; | 3768 | |
| 3795 | len++; | 3769 | if (p1 >= leftmargin && p1 < endp) |
| 3796 | goto label_display_binary_data; | 3770 | *p1 = (fix_glyph |
| 3771 | (f, | ||
| 3772 | (dp && INTEGERP (DISP_ESCAPE_GLYPH (dp)) | ||
| 3773 | && GLYPH_CHAR_VALID_P (XINT (DISP_ESCAPE_GLYPH (dp))) | ||
| 3774 | ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'), | ||
| 3775 | current_face) | ||
| 3776 | | rev_dir_bit); | ||
| 3777 | p1++; | ||
| 3778 | if (p1 >= leftmargin && p1 < endp) | ||
| 3779 | *p1 = (MAKE_GLYPH (f, (c >> 6) + '0', current_face) | ||
| 3780 | | rev_dir_bit); | ||
| 3781 | p1++; | ||
| 3782 | if (p1 >= leftmargin && p1 < endp) | ||
| 3783 | *p1 = (MAKE_GLYPH (f, (7 & (c >> 3)) + '0', current_face) | ||
| 3784 | | rev_dir_bit); | ||
| 3785 | p1++; | ||
| 3786 | if (p1 >= leftmargin && p1 < endp) | ||
| 3787 | *p1 = (MAKE_GLYPH (f, (7 & c) + '0', current_face) | ||
| 3788 | | rev_dir_bit); | ||
| 3789 | p1++; | ||
| 3797 | } | 3790 | } |
| 3798 | } | 3791 | } |
| 3799 | 3792 | ||