comparison src/search.c @ 90533:8a8e69664178

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 343-356) - Update from CVS - Update for ERC 5.1.3. - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 113-115) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-90
author Miles Bader <miles@gnu.org>
date Wed, 19 Jul 2006 00:42:56 +0000
parents a8190f7e546e 6dd00de34fff
children a1a25ac6c88a
comparison
equal deleted inserted replaced
90532:e22cf6d2400c 90533:8a8e69664178
80 static Lisp_Object last_thing_searched; 80 static Lisp_Object last_thing_searched;
81 81
82 /* error condition signaled when regexp compile_pattern fails */ 82 /* error condition signaled when regexp compile_pattern fails */
83 83
84 Lisp_Object Qinvalid_regexp; 84 Lisp_Object Qinvalid_regexp;
85
86 /* Error condition used for failing searches */
87 Lisp_Object Qsearch_failed;
85 88
86 Lisp_Object Vsearch_spaces_regexp; 89 Lisp_Object Vsearch_spaces_regexp;
87 90
88 static void set_search_regs (); 91 static void set_search_regs ();
89 static void save_search_regs (); 92 static void save_search_regs ();
143 re_set_whitespace_regexp (NULL); 146 re_set_whitespace_regexp (NULL);
144 147
145 re_set_syntax (old); 148 re_set_syntax (old);
146 UNBLOCK_INPUT; 149 UNBLOCK_INPUT;
147 if (val) 150 if (val)
148 Fsignal (Qinvalid_regexp, Fcons (build_string (val), Qnil)); 151 xsignal1 (Qinvalid_regexp, build_string (val));
149 152
150 cp->regexp = Fcopy_sequence (pattern); 153 cp->regexp = Fcopy_sequence (pattern);
151 } 154 }
152 155
153 /* Shrink each compiled regexp buffer in the cache 156 /* Shrink each compiled regexp buffer in the cache
230 re_set_registers (&cp->buf, regp, regp->num_regs, regp->start, regp->end); 233 re_set_registers (&cp->buf, regp, regp->num_regs, regp->start, regp->end);
231 234
232 return &cp->buf; 235 return &cp->buf;
233 } 236 }
234 237
235 /* Error condition used for failing searches */
236 Lisp_Object Qsearch_failed;
237
238 Lisp_Object
239 signal_failure (arg)
240 Lisp_Object arg;
241 {
242 Fsignal (Qsearch_failed, Fcons (arg, Qnil));
243 return Qnil;
244 }
245 238
246 static Lisp_Object 239 static Lisp_Object
247 looking_at_1 (string, posix) 240 looking_at_1 (string, posix)
248 Lisp_Object string; 241 Lisp_Object string;
249 int posix; 242 int posix;
912 : Qnil), 905 : Qnil),
913 posix); 906 posix);
914 if (np <= 0) 907 if (np <= 0)
915 { 908 {
916 if (NILP (noerror)) 909 if (NILP (noerror))
917 return signal_failure (string); 910 xsignal1 (Qsearch_failed, string);
911
918 if (!EQ (noerror, Qt)) 912 if (!EQ (noerror, Qt))
919 { 913 {
920 if (lim < BEGV || lim > ZV) 914 if (lim < BEGV || lim > ZV)
921 abort (); 915 abort ();
922 SET_PT_BOTH (lim, lim_byte); 916 SET_PT_BOTH (lim, lim_byte);
2848 register Lisp_Object marker; 2842 register Lisp_Object marker;
2849 2843
2850 if (running_asynch_code) 2844 if (running_asynch_code)
2851 save_search_regs (); 2845 save_search_regs ();
2852 2846
2853 if (!CONSP (list) && !NILP (list)) 2847 CHECK_LIST (list);
2854 list = wrong_type_argument (Qconsp, list);
2855 2848
2856 /* Unless we find a marker with a buffer or an explicit buffer 2849 /* Unless we find a marker with a buffer or an explicit buffer
2857 in LIST, assume that this match data came from a string. */ 2850 in LIST, assume that this match data came from a string. */
2858 last_thing_searched = Qt; 2851 last_thing_searched = Qt;
2859 2852