diff options
| author | Kenichi Handa | 2004-12-11 02:14:43 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-12-11 02:14:43 +0000 |
| commit | bbc73b48ac56f8fcc94df00c6d762ce3a043fcaf (patch) | |
| tree | 3e3b367bb8fa81424abecddebf90af9de6fbe8f3 /src | |
| parent | aee31bf1068104d11065752ded7278f0423821ec (diff) | |
| download | emacs-bbc73b48ac56f8fcc94df00c6d762ce3a043fcaf.tar.gz emacs-bbc73b48ac56f8fcc94df00c6d762ce3a043fcaf.zip | |
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 () | |||
| 108 | POSIX is nonzero if we want full backtracking (POSIX style) | 108 | POSIX is nonzero if we want full backtracking (POSIX style) |
| 109 | for this pattern. 0 means backtrack only enough to get a valid match. | 109 | for this pattern. 0 means backtrack only enough to get a valid match. |
| 110 | MULTIBYTE is nonzero iff a target of match is a multibyte buffer or | 110 | MULTIBYTE is nonzero iff a target of match is a multibyte buffer or |
| 111 | string. */ | 111 | string. |
| 112 | |||
| 113 | The behavior also depends on Vsearch_spaces_regexp. */ | ||
| 112 | 114 | ||
| 113 | static void | 115 | static void |
| 114 | compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) | 116 | compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) |
| @@ -127,11 +129,18 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) | |||
| 127 | cp->posix = posix; | 129 | cp->posix = posix; |
| 128 | cp->buf.multibyte = STRING_MULTIBYTE (pattern); | 130 | cp->buf.multibyte = STRING_MULTIBYTE (pattern); |
| 129 | cp->buf.target_multibyte = multibyte; | 131 | cp->buf.target_multibyte = multibyte; |
| 132 | cp->whitespace_regexp = Vsearch_spaces_regexp; | ||
| 130 | BLOCK_INPUT; | 133 | BLOCK_INPUT; |
| 131 | old = re_set_syntax (RE_SYNTAX_EMACS | 134 | old = re_set_syntax (RE_SYNTAX_EMACS |
| 132 | | (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); | 135 | | (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); |
| 136 | re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL | ||
| 137 | : SDATA (Vsearch_spaces_regexp)); | ||
| 138 | |||
| 133 | val = (char *) re_compile_pattern ((char *) SDATA (pattern), | 139 | val = (char *) re_compile_pattern ((char *) SDATA (pattern), |
| 134 | SBYTES (pattern), &cp->buf); | 140 | SBYTES (pattern), &cp->buf); |
| 141 | |||
| 142 | re_set_whitespace_regexp (NULL); | ||
| 143 | |||
| 135 | re_set_syntax (old); | 144 | re_set_syntax (old); |
| 136 | UNBLOCK_INPUT; | 145 | UNBLOCK_INPUT; |
| 137 | if (val) | 146 | if (val) |
| @@ -192,7 +201,8 @@ compile_pattern (pattern, regp, translate, posix, multibyte) | |||
| 192 | && !NILP (Fstring_equal (cp->regexp, pattern)) | 201 | && !NILP (Fstring_equal (cp->regexp, pattern)) |
| 193 | && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) | 202 | && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) |
| 194 | && cp->posix == posix | 203 | && cp->posix == posix |
| 195 | && cp->buf.target_multibyte == multibyte) | 204 | && cp->buf.target_multibyte == multibyte |
| 205 | && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp))) | ||
| 196 | break; | 206 | break; |
| 197 | 207 | ||
| 198 | /* If we're at the end of the cache, compile into the nil cell | 208 | /* If we're at the end of the cache, compile into the nil cell |