Mercurial > emacs
comparison src/xdisp.c @ 29023:af50e87cc257
(get_next_display_element): Handle 8-bit characters
correctly.
(next_element_from_display_vector): Use CHAR_BYTES instead of
CHAR_LEN.
(disp_char_vector): Use SPLIT_CHAR instead of
SPLIT_NON_ASCII_CHAR.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sat, 20 May 2000 00:07:43 +0000 |
parents | 540ca0531c77 |
children | 239420a3c60d |
comparison
equal
deleted
inserted
replaced
29022:3eec558de0ef | 29023:af50e87cc257 |
---|---|
3421 get_next_display_element (it); | 3421 get_next_display_element (it); |
3422 } | 3422 } |
3423 else | 3423 else |
3424 { | 3424 { |
3425 unsigned char str[MAX_MULTIBYTE_LENGTH]; | 3425 unsigned char str[MAX_MULTIBYTE_LENGTH]; |
3426 int len = CHAR_STRING (it->c, str); | 3426 int len; |
3427 int i; | 3427 int i; |
3428 GLYPH escape_glyph; | 3428 GLYPH escape_glyph; |
3429 | 3429 |
3430 /* Set IT->ctl_chars[0] to the glyph for `\\'. */ | 3430 /* Set IT->ctl_chars[0] to the glyph for `\\'. */ |
3431 if (it->dp | 3431 if (it->dp |
3432 && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) | 3432 && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) |
3433 && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) | 3433 && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) |
3434 escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp)); | 3434 escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp)); |
3435 else | 3435 else |
3436 escape_glyph = FAST_MAKE_GLYPH ('\\', 0); | 3436 escape_glyph = FAST_MAKE_GLYPH ('\\', 0); |
3437 | |
3438 if (SINGLE_BYTE_CHAR_P (it->c)) | |
3439 str[0] = it->c, len = 1; | |
3440 else | |
3441 len = CHAR_STRING (it->c, str); | |
3437 | 3442 |
3438 for (i = 0; i < len; i++) | 3443 for (i = 0; i < len; i++) |
3439 { | 3444 { |
3440 XSETINT (it->ctl_chars[i * 4], escape_glyph); | 3445 XSETINT (it->ctl_chars[i * 4], escape_glyph); |
3441 /* Insert three more glyphs into IT->ctl_chars for | 3446 /* Insert three more glyphs into IT->ctl_chars for |
3662 int lface_id; | 3667 int lface_id; |
3663 GLYPH g; | 3668 GLYPH g; |
3664 | 3669 |
3665 g = XFASTINT (it->dpvec[it->current.dpvec_index]); | 3670 g = XFASTINT (it->dpvec[it->current.dpvec_index]); |
3666 it->c = FAST_GLYPH_CHAR (g); | 3671 it->c = FAST_GLYPH_CHAR (g); |
3667 it->len = CHAR_LEN (it->c); | 3672 it->len = CHAR_BYTES (it->c); |
3668 | 3673 |
3669 /* The entry may contain a face id to use. Such a face id is | 3674 /* The entry may contain a face id to use. Such a face id is |
3670 the id of a Lisp face, not a realized face. A face id of | 3675 the id of a Lisp face, not a realized face. A face id of |
3671 zero means no face. */ | 3676 zero means no face. */ |
3672 lface_id = FAST_GLYPH_FACE (g); | 3677 lface_id = FAST_GLYPH_FACE (g); |
7988 Lisp_Object val; | 7993 Lisp_Object val; |
7989 | 7994 |
7990 if (SINGLE_BYTE_CHAR_P (c)) | 7995 if (SINGLE_BYTE_CHAR_P (c)) |
7991 return (dp->contents[c]); | 7996 return (dp->contents[c]); |
7992 | 7997 |
7993 SPLIT_NON_ASCII_CHAR (c, code[0], code[1], code[2]); | 7998 SPLIT_CHAR (c, code[0], code[1], code[2]); |
7994 if (code[1] < 32) | 7999 if (code[1] < 32) |
7995 code[1] = -1; | 8000 code[1] = -1; |
7996 else if (code[2] < 32) | 8001 else if (code[2] < 32) |
7997 code[2] = -1; | 8002 code[2] = -1; |
7998 | 8003 |