83 |
|
|
84 |
Lisp_Object Qinvalid_regexp; |
Lisp_Object Qinvalid_regexp; |
85 |
|
|
86 |
|
Lisp_Object Vsearch_whitespace_regexp; |
87 |
|
|
88 |
static void set_search_regs (); |
static void set_search_regs (); |
89 |
static void save_search_regs (); |
static void save_search_regs (); |
90 |
static int simple_search (); |
static int simple_search (); |
163 |
BLOCK_INPUT; |
BLOCK_INPUT; |
164 |
old = re_set_syntax (RE_SYNTAX_EMACS |
old = re_set_syntax (RE_SYNTAX_EMACS |
165 |
| (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); |
| (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); |
166 |
|
|
167 |
|
re_set_whitespace_regexp (NILP (Vsearch_whitespace_regexp) ? NULL |
168 |
|
: SDATA (Vsearch_whitespace_regexp)); |
169 |
|
|
170 |
val = (char *) re_compile_pattern ((char *)raw_pattern, |
val = (char *) re_compile_pattern ((char *)raw_pattern, |
171 |
raw_pattern_size, &cp->buf); |
raw_pattern_size, &cp->buf); |
172 |
|
|
173 |
|
re_set_whitespace_regexp (NULL); |
174 |
|
|
175 |
re_set_syntax (old); |
re_set_syntax (old); |
176 |
UNBLOCK_INPUT; |
UNBLOCK_INPUT; |
177 |
if (val) |
if (val) |
1060 |
return pos; |
return pos; |
1061 |
} |
} |
1062 |
|
|
1063 |
if (RE && !trivial_regexp_p (string)) |
if (RE && !(trivial_regexp_p (string) && NILP (Vsearch_whitespace_regexp))) |
1064 |
{ |
{ |
1065 |
unsigned char *p1, *p2; |
unsigned char *p1, *p2; |
1066 |
int s1, s2; |
int s1, s2; |
3007 |
saved_last_thing_searched = Qnil; |
saved_last_thing_searched = Qnil; |
3008 |
staticpro (&saved_last_thing_searched); |
staticpro (&saved_last_thing_searched); |
3009 |
|
|
3010 |
|
DEFVAR_LISP ("search-whitespace-regexp", &Vsearch_whitespace_regexp, |
3011 |
|
/* doc: Regexp to substitute for bunches of spaces in regexp search. |
3012 |
|
Some commands use this for user-specified regexps. |
3013 |
|
Spaces that occur inside character classes or repetition operators |
3014 |
|
or other such regexp constructs are not replaced with this. |
3015 |
|
A value of nil (which is the normal value) means treat spaces literally. */); |
3016 |
|
Vsearch_whitespace_regexp = Qnil; |
3017 |
|
|
3018 |
defsubr (&Slooking_at); |
defsubr (&Slooking_at); |
3019 |
defsubr (&Sposix_looking_at); |
defsubr (&Sposix_looking_at); |
3020 |
defsubr (&Sstring_match); |
defsubr (&Sstring_match); |