aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1993-06-10 12:52:31 +0000
committerJim Blandy1993-06-10 12:52:31 +0000
commit2d52e48f106dd5d6b935b4eedc79664004b26032 (patch)
tree2515ffa6fd0b33d5945ed1d1c0b36bedfa1ec8f4 /src
parent85be31013c1b4dc8d624d051f6156dafcd336d36 (diff)
downloademacs-2d52e48f106dd5d6b935b4eedc79664004b26032.tar.gz
emacs-2d52e48f106dd5d6b935b4eedc79664004b26032.zip
* search.c (Flooking_at, Fstring_match, fast_string_match,
search_buffer): Don't block input while calling searching and matching functions. These functions may not call malloc under Emacs anyway, and we need to be able to check for C-g.
Diffstat (limited to 'src')
-rw-r--r--src/search.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/search.c b/src/search.c
index d9c4554cb92..b43756f0a5c 100644
--- a/src/search.c
+++ b/src/search.c
@@ -172,11 +172,9 @@ data if you want to preserve them.")
172 s2 = 0; 172 s2 = 0;
173 } 173 }
174 174
175 BLOCK_INPUT;
176 i = re_match_2 (&searchbuf, (char *) p1, s1, (char *) p2, s2, 175 i = re_match_2 (&searchbuf, (char *) p1, s1, (char *) p2, s2,
177 point - BEGV, &search_regs, 176 point - BEGV, &search_regs,
178 ZV - BEGV); 177 ZV - BEGV);
179 UNBLOCK_INPUT;
180 if (i == -2) 178 if (i == -2)
181 matcher_overflow (); 179 matcher_overflow ();
182 180
@@ -224,11 +222,9 @@ matched by parenthesis constructs in the pattern.")
224 compile_pattern (regexp, &searchbuf, &search_regs, 222 compile_pattern (regexp, &searchbuf, &search_regs,
225 !NILP (current_buffer->case_fold_search) ? DOWNCASE_TABLE : 0); 223 !NILP (current_buffer->case_fold_search) ? DOWNCASE_TABLE : 0);
226 immediate_quit = 1; 224 immediate_quit = 1;
227 BLOCK_INPUT;
228 val = re_search (&searchbuf, (char *) XSTRING (string)->data, 225 val = re_search (&searchbuf, (char *) XSTRING (string)->data,
229 XSTRING (string)->size, s, XSTRING (string)->size - s, 226 XSTRING (string)->size, s, XSTRING (string)->size - s,
230 &search_regs); 227 &search_regs);
231 UNBLOCK_INPUT;
232 immediate_quit = 0; 228 immediate_quit = 0;
233 last_thing_searched = Qt; 229 last_thing_searched = Qt;
234 if (val == -2) 230 if (val == -2)
@@ -249,11 +245,9 @@ fast_string_match (regexp, string)
249 245
250 compile_pattern (regexp, &searchbuf, 0, 0); 246 compile_pattern (regexp, &searchbuf, 0, 0);
251 immediate_quit = 1; 247 immediate_quit = 1;
252 BLOCK_INPUT;
253 val = re_search (&searchbuf, (char *) XSTRING (string)->data, 248 val = re_search (&searchbuf, (char *) XSTRING (string)->data,
254 XSTRING (string)->size, 0, XSTRING (string)->size, 249 XSTRING (string)->size, 0, XSTRING (string)->size,
255 0); 250 0);
256 UNBLOCK_INPUT;
257 immediate_quit = 0; 251 immediate_quit = 0;
258 return val; 252 return val;
259} 253}
@@ -671,12 +665,10 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt)
671 while (n < 0) 665 while (n < 0)
672 { 666 {
673 int val; 667 int val;
674 BLOCK_INPUT;
675 val = re_search_2 (&searchbuf, (char *) p1, s1, (char *) p2, s2, 668 val = re_search_2 (&searchbuf, (char *) p1, s1, (char *) p2, s2,
676 pos - BEGV, lim - pos, &search_regs, 669 pos - BEGV, lim - pos, &search_regs,
677 /* Don't allow match past current point */ 670 /* Don't allow match past current point */
678 pos - BEGV); 671 pos - BEGV);
679 UNBLOCK_INPUT;
680 if (val == -2) 672 if (val == -2)
681 matcher_overflow (); 673 matcher_overflow ();
682 if (val >= 0) 674 if (val >= 0)
@@ -702,11 +694,9 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt)
702 while (n > 0) 694 while (n > 0)
703 { 695 {
704 int val; 696 int val;
705 BLOCK_INPUT;
706 val = re_search_2 (&searchbuf, (char *) p1, s1, (char *) p2, s2, 697 val = re_search_2 (&searchbuf, (char *) p1, s1, (char *) p2, s2,
707 pos - BEGV, lim - pos, &search_regs, 698 pos - BEGV, lim - pos, &search_regs,
708 lim - BEGV); 699 lim - BEGV);
709 UNBLOCK_INPUT;
710 if (val == -2) 700 if (val == -2)
711 matcher_overflow (); 701 matcher_overflow ();
712 if (val >= 0) 702 if (val >= 0)