X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsearch.c;h=b5ac56d6856b4f99234fc009e1c2fe58d4e5e7ee;hb=37bdb8647edead5a0e669c6ec27841d470a9e5e6;hp=b686c51bb237de96660489680182e94d51181ce7;hpb=32abbaa18a056e253401052430d965acc83d395e;p=chise%2Fxemacs-chise.git diff --git a/src/search.c b/src/search.c index b686c51..b5ac56d 100644 --- a/src/search.c +++ b/src/search.c @@ -1,6 +1,7 @@ /* String search routines for XEmacs. Copyright (C) 1985, 1986, 1987, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. + Copyright (C) 1999,2000,2001 MORIOKA Tomohiko This file is part of XEmacs. @@ -784,7 +785,11 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp, unsigned char fastmap[0400]; int negate = 0; REGISTER int i; +#ifdef UTF2000 + Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->syntax_table); +#else Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); +#endif Bufpos limit; if (NILP (lim)) @@ -1278,11 +1283,7 @@ 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); + int charset_base_code = c >> 6; #else int charset_base_code = c & ~CHAR_FIELD3_MASK; #endif @@ -1580,16 +1581,12 @@ 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)) + if (charset_base == (untranslated >> 6)) #else if (charset_base == (untranslated & ~CHAR_FIELD3_MASK)) #endif @@ -1942,7 +1939,11 @@ wordify (Lisp_Object buffer, Lisp_Object string) Charcount i, len; EMACS_INT punct_count = 0, word_count = 0; struct buffer *buf = decode_buffer (buffer, 0); +#ifdef UTF2000 + Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->syntax_table); +#else Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); +#endif CHECK_STRING (string); len = XSTRING_CHAR_LENGTH (string); @@ -2298,7 +2299,11 @@ and you do not need to specify it. buf = XBUFFER (buffer); } +#ifdef UTF2000 + syntax_table = XCHAR_TABLE (buf->syntax_table); +#else syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); +#endif case_action = nochange; /* We tried an initialization */ /* but some C compilers blew it */