From: tomo Date: Sat, 9 Dec 2000 09:13:13 +0000 (+0000) Subject: (search_buffer): Use charset-id as charset_base_code in UTF-2000 [I'm X-Git-Tag: r21-2-38-utf-2000-0_17-1~954 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=32abbaa18a056e253401052430d965acc83d395e;p=chise%2Fxemacs-chise.git- (search_buffer): Use charset-id as charset_base_code in UTF-2000 [I'm not sure it is right thing]. (boyer_moore): Likewise. --- diff --git a/src/search.c b/src/search.c index 169e1d7..b686c51 100644 --- a/src/search.c +++ b/src/search.c @@ -1277,7 +1277,15 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, { /* Keep track of which character set row contains the characters that need translation. */ +#ifdef UTF2000 + Lisp_Object ccs; + int charset_base_code; + + ENCODE_CHAR (c, ccs); + charset_base_code = XCHARSET_ID (ccs); +#else int charset_base_code = c & ~CHAR_FIELD3_MASK; +#endif if (charset_base == -1) charset_base = charset_base_code; else if (charset_base != charset_base_code) @@ -1572,11 +1580,19 @@ boyer_moore (struct buffer *buf, Bufbyte *base_pat, Bytecount len, /* Is *PTR the last byte of a character? */ if (pat_end - ptr == 1 || BUFBYTE_FIRST_BYTE_P (ptr[1])) { +#ifdef UTF2000 + Lisp_Object ccs; +#endif Bufbyte *charstart = ptr; while (!BUFBYTE_FIRST_BYTE_P (*charstart)) charstart--; untranslated = charptr_emchar (charstart); +#ifdef UTF2000 + ENCODE_CHAR (untranslated, ccs); + if (charset_base == XCHARSET_ID (ccs)) +#else if (charset_base == (untranslated & ~CHAR_FIELD3_MASK)) +#endif { ch = TRANSLATE (trt, untranslated); if (!BUFBYTE_FIRST_BYTE_P (*ptr))