diff options
| author | Kenichi Handa <handa@m17n.org> | 2004-12-11 02:14:43 +0000 |
|---|---|---|
| committer | Kenichi Handa <handa@m17n.org> | 2004-12-11 02:14:43 +0000 |
| commit | bbc73b48ac56f8fcc94df00c6d762ce3a043fcaf (patch) | |
| tree | 3e3b367bb8fa81424abecddebf90af9de6fbe8f3 /src | |
| parent | aee31bf1068104d11065752ded7278f0423821ec (diff) | |
| download | emacs-bbc73b48ac56f8fcc94df00c6d762ce3a043fcaf.tar.gz | |
Sync to the change in HEAD on 2004-11-19, 20.
Diffstat (limited to 'src')
| -rw-r--r-- | src/search.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c index 41b71934e9f..30e4be41ca9 100644 --- a/src/search.c +++ b/src/search.c @@ -108,7 +108,9 @@ matcher_overflow () POSIX is nonzero if we want full backtracking (POSIX style) for this pattern. 0 means backtrack only enough to get a valid match. MULTIBYTE is nonzero iff a target of match is a multibyte buffer or - string. */ + string. + + The behavior also depends on Vsearch_spaces_regexp. */ static void compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) @@ -127,11 +129,18 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) cp->posix = posix; cp->buf.multibyte = STRING_MULTIBYTE (pattern); cp->buf.target_multibyte = multibyte; + cp->whitespace_regexp = Vsearch_spaces_regexp; BLOCK_INPUT; old = re_set_syntax (RE_SYNTAX_EMACS | (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); + re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL + : SDATA (Vsearch_spaces_regexp)); + val = (char *) re_compile_pattern ((char *) SDATA (pattern), SBYTES (pattern), &cp->buf); + + re_set_whitespace_regexp (NULL); + re_set_syntax (old); UNBLOCK_INPUT; if (val) @@ -192,7 +201,8 @@ compile_pattern (pattern, regp, translate, posix, multibyte) && !NILP (Fstring_equal (cp->regexp, pattern)) && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) && cp->posix == posix - && cp->buf.target_multibyte == multibyte) + && cp->buf.target_multibyte == multibyte + && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp))) break; /* If we're at the end of the cache, compile into the nil cell |
