From: Miles Bader Date: Sun, 15 Oct 2006 02:54:13 +0000 (+0000) Subject: Merge from emacs--devo--0 X-Git-Tag: emacs-pretest-23.0.90~8295^2~736 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb9c4b4f8b3dcd1b5fc96d2d0275cc532832fbd6;p=emacs.git Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 460-475) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 145-152) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-118 --- bb9c4b4f8b3dcd1b5fc96d2d0275cc532832fbd6 diff --cc src/frame.c index c57618696eb,0b835ffd3b9..f431dc4946d --- a/src/frame.c +++ b/src/frame.c @@@ -112,10 -108,8 +112,11 @@@ Lisp_Object Qbuffer_predicate, Qbuffer_ Lisp_Object Qtty_color_mode; Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; +#ifdef USE_FONT_BACKEND +Lisp_Object Qfont_backend; +#endif /* USE_FONT_BACKEND */ + Lisp_Object Qinhibit_face_set_after_frame_default; Lisp_Object Qface_set_after_frame_default; diff --cc src/regex.c index 09776848220,ae80ad0cee8..2eca58c23e8 --- a/src/regex.c +++ b/src/regex.c @@@ -2987,33 -2932,25 +2988,41 @@@ regex_compile (pattern, size, syntax, b don't need to handle them for multibyte. They are distinguished by a negative wctype. */ - if (multibyte) - SET_RANGE_TABLE_WORK_AREA_BIT (range_table_work, - re_wctype_to_bit (cc)); + for (ch = 0; ch < 128; ++ch) + if (re_iswctype (btowc (ch), cc)) + { + c = TRANSLATE (ch); + SET_LIST_BIT (c); + } - for (ch = 0; ch < 1 << BYTEWIDTH; ++ch) + if (target_multibyte) + { + SET_RANGE_TABLE_WORK_AREA_BIT + (range_table_work, re_wctype_to_bit (cc)); + } + else { - int translated = TRANSLATE (ch); - if (re_iswctype (btowc (ch), cc)) - SET_LIST_BIT (translated); + for (ch = 0; ch < (1 << BYTEWIDTH); ++ch) + { + c = ch; + MAKE_CHAR_MULTIBYTE (c); + if (re_iswctype (btowc (c), cc)) + { + c = TRANSLATE (c); + MAKE_CHAR_UNIBYTE (c); + SET_LIST_BIT (c); + } + } } + /* In most cases the matching rule for char classes + only uses the syntax table for multibyte chars, + so that the content of the syntax-table it is not + hardcoded in the range_table. SPACE and WORD are + the two exceptions. */ + if ((1 << cc) & ((1 << RECC_SPACE) | (1 << RECC_WORD))) + bufp->used_syntax = 1; + /* Repeat the loop. */ continue; } diff --cc src/regex.h index efae7749f31,14817c35e90..e065c597d49 --- a/src/regex.h +++ b/src/regex.h @@@ -392,16 -392,14 +392,20 @@@ struct re_pattern_buffe /* Similarly for an end-of-line anchor. */ unsigned not_eol : 1; + /* If true, the compilation of the pattern had to look up the syntax table, + so the compiled pattern is only valid for the current syntax table. */ + unsigned used_syntax : 1; + #ifdef emacs - /* If true, multi-byte form in the `buffer' should be recognized as a - multibyte character. */ + /* If true, multi-byte form in the regexp pattern should be + recognized as a multibyte character. When the pattern is + compiled, this is set to the same value as target_multibyte + below. */ unsigned multibyte : 1; + + /* If true, multi-byte form in the target of match should be + recognized as a multibyte character. */ + unsigned target_multibyte : 1; #endif /* [[[end pattern_buffer]]] */ diff --cc src/search.c index 5f3f953595b,7c3151b76b8..7c1090aa2bf --- a/src/search.c +++ b/src/search.c @@@ -134,10 -138,39 +135,9 @@@ compile_pattern_1 (cp, pattern, transla cp->regexp = Qnil; cp->buf.translate = (! NILP (translate) ? translate : make_number (0)); cp->posix = posix; - cp->buf.multibyte = multibyte; + cp->buf.multibyte = STRING_MULTIBYTE (pattern); + cp->buf.target_multibyte = multibyte; cp->whitespace_regexp = Vsearch_spaces_regexp; - cp->syntax_table = current_buffer->syntax_table; /* rms: I think BLOCK_INPUT is not needed here any more, because regex.c defines malloc to call xmalloc. Using BLOCK_INPUT here means the debugger won't run if an error occurs. @@@ -148,9 -181,14 +148,13 @@@ re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL : SDATA (Vsearch_spaces_regexp)); - val = (char *) re_compile_pattern ((char *)raw_pattern, - raw_pattern_size, &cp->buf); + val = (char *) re_compile_pattern ((char *) SDATA (pattern), + SBYTES (pattern), &cp->buf); + /* If the compiled pattern hard codes some of the contents of the + syntax-table, it can only be reused with *this* syntax table. */ + cp->syntax_table = cp->buf.used_syntax ? current_buffer->syntax_table : Qt; + re_set_whitespace_regexp (NULL); re_set_syntax (old); @@@ -226,11 -269,9 +235,9 @@@ compile_pattern (pattern, regp, transla && !NILP (Fstring_equal (cp->regexp, pattern)) && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) && cp->posix == posix - && cp->buf.multibyte == multibyte + && cp->buf.target_multibyte == multibyte - /* TODO: Strictly speaking, we only need to match syntax - tables when a character class like [[:space:]] occurs in - the pattern. -- cyd*/ - && EQ (cp->syntax_table, current_buffer->syntax_table) + && (EQ (cp->syntax_table, Qt) + || EQ (cp->syntax_table, current_buffer->syntax_table)) && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp))) break;