From: Kenichi Handa Date: Sat, 20 May 2000 00:07:43 +0000 (+0000) Subject: (get_next_display_element): Handle 8-bit characters X-Git-Tag: emacs-pretest-21.0.90~3863 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c5924f47e9335d100b81184d176d1a68ffaac5ea;p=emacs.git (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. --- diff --git a/src/xdisp.c b/src/xdisp.c index 30f7a00ec01..b441f5a2488 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3423,7 +3423,7 @@ get_next_display_element (it) else { unsigned char str[MAX_MULTIBYTE_LENGTH]; - int len = CHAR_STRING (it->c, str); + int len; int i; GLYPH escape_glyph; @@ -3435,6 +3435,11 @@ get_next_display_element (it) else escape_glyph = FAST_MAKE_GLYPH ('\\', 0); + if (SINGLE_BYTE_CHAR_P (it->c)) + str[0] = it->c, len = 1; + else + len = CHAR_STRING (it->c, str); + for (i = 0; i < len; i++) { XSETINT (it->ctl_chars[i * 4], escape_glyph); @@ -3664,7 +3669,7 @@ next_element_from_display_vector (it) g = XFASTINT (it->dpvec[it->current.dpvec_index]); it->c = FAST_GLYPH_CHAR (g); - it->len = CHAR_LEN (it->c); + it->len = CHAR_BYTES (it->c); /* The entry may contain a face id to use. Such a face id is the id of a Lisp face, not a realized face. A face id of @@ -7990,7 +7995,7 @@ disp_char_vector (dp, c) if (SINGLE_BYTE_CHAR_P (c)) return (dp->contents[c]); - SPLIT_NON_ASCII_CHAR (c, code[0], code[1], code[2]); + SPLIT_CHAR (c, code[0], code[1], code[2]); if (code[1] < 32) code[1] = -1; else if (code[2] < 32)