changeset 90063:cd540ce7f0fc

Sync to the change in HEAD on 2004-11-19, 20.
author Kenichi Handa <handa@m17n.org>
date Sat, 11 Dec 2004 02:14:43 +0000
parents e1efd2496a29
children ab2dd65dad92
files src/search.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Sat Dec 11 02:13:31 2004 +0000
+++ b/src/search.c	Sat Dec 11 02:14:43 2004 +0000
@@ -108,7 +108,9 @@
    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 @@
   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 @@
 	  && !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