/[emacs]/emacs/src/search.c
ViewVC logotype

Diff of /emacs/src/search.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.159 by pj, Wed Oct 24 20:17:33 2001 UTC revision 1.160 by pj, Fri Nov 2 20:33:08 2001 UTC
# Line 276  looking_at_1 (string, posix) Line 276  looking_at_1 (string, posix)
276    if (running_asynch_code)    if (running_asynch_code)
277      save_search_regs ();      save_search_regs ();
278    
279    CHECK_STRING (string, 0);    CHECK_STRING (string);
280    bufp = compile_pattern (string, &search_regs,    bufp = compile_pattern (string, &search_regs,
281                            (!NILP (current_buffer->case_fold_search)                            (!NILP (current_buffer->case_fold_search)
282                             ? DOWNCASE_TABLE : Qnil),                             ? DOWNCASE_TABLE : Qnil),
# Line 365  string_match_1 (regexp, string, start, p Line 365  string_match_1 (regexp, string, start, p
365    if (running_asynch_code)    if (running_asynch_code)
366      save_search_regs ();      save_search_regs ();
367    
368    CHECK_STRING (regexp, 0);    CHECK_STRING (regexp);
369    CHECK_STRING (string, 1);    CHECK_STRING (string);
370    
371    if (NILP (start))    if (NILP (start))
372      pos = 0, pos_byte = 0;      pos = 0, pos_byte = 0;
# Line 374  string_match_1 (regexp, string, start, p Line 374  string_match_1 (regexp, string, start, p
374      {      {
375        int len = XSTRING (string)->size;        int len = XSTRING (string)->size;
376    
377        CHECK_NUMBER (start, 2);        CHECK_NUMBER (start);
378        pos = XINT (start);        pos = XINT (start);
379        if (pos < 0 && -pos <= len)        if (pos < 0 && -pos <= len)
380          pos = len + pos;          pos = len + pos;
# Line 872  search_command (string, bound, noerror, Line 872  search_command (string, bound, noerror,
872    
873    if (!NILP (count))    if (!NILP (count))
874      {      {
875        CHECK_NUMBER (count, 3);        CHECK_NUMBER (count);
876        n *= XINT (count);        n *= XINT (count);
877      }      }
878    
879    CHECK_STRING (string, 0);    CHECK_STRING (string);
880    if (NILP (bound))    if (NILP (bound))
881      {      {
882        if (n > 0)        if (n > 0)
# Line 886  search_command (string, bound, noerror, Line 886  search_command (string, bound, noerror,
886      }      }
887    else    else
888      {      {
889        CHECK_NUMBER_COERCE_MARKER (bound, 1);        CHECK_NUMBER_COERCE_MARKER (bound);
890        lim = XINT (bound);        lim = XINT (bound);
891        if (n > 0 ? lim < PT : lim > PT)        if (n > 0 ? lim < PT : lim > PT)
892          error ("Invalid search bound (wrong side of point)");          error ("Invalid search bound (wrong side of point)");
# Line 1943  wordify (string) Line 1943  wordify (string)
1943    int prev_c = 0;    int prev_c = 0;
1944    int adjust;    int adjust;
1945    
1946    CHECK_STRING (string, 0);    CHECK_STRING (string);
1947    p = XSTRING (string)->data;    p = XSTRING (string)->data;
1948    len = XSTRING (string)->size;    len = XSTRING (string)->size;
1949    
# Line 2203  since only regular expressions have dist Line 2203  since only regular expressions have dist
2203    int sub;    int sub;
2204    int opoint, newpoint;    int opoint, newpoint;
2205    
2206    CHECK_STRING (newtext, 0);    CHECK_STRING (newtext);
2207    
2208    if (! NILP (string))    if (! NILP (string))
2209      CHECK_STRING (string, 4);      CHECK_STRING (string);
2210    
2211    case_action = nochange;       /* We tried an initialization */    case_action = nochange;       /* We tried an initialization */
2212                                  /* but some C compilers blew it */                                  /* but some C compilers blew it */
# Line 2218  since only regular expressions have dist Line 2218  since only regular expressions have dist
2218      sub = 0;      sub = 0;
2219    else    else
2220      {      {
2221        CHECK_NUMBER (subexp, 3);        CHECK_NUMBER (subexp);
2222        sub = XINT (subexp);        sub = XINT (subexp);
2223        if (sub < 0 || sub >= search_regs.num_regs)        if (sub < 0 || sub >= search_regs.num_regs)
2224          args_out_of_range (subexp, make_number (search_regs.num_regs));          args_out_of_range (subexp, make_number (search_regs.num_regs));
# Line 2581  match_limit (num, beginningp) Line 2581  match_limit (num, beginningp)
2581  {  {
2582    register int n;    register int n;
2583    
2584    CHECK_NUMBER (num, 0);    CHECK_NUMBER (num);
2585    n = XINT (num);    n = XINT (num);
2586    if (n < 0 || n >= search_regs.num_regs)    if (n < 0 || n >= search_regs.num_regs)
2587      args_out_of_range (num, make_number (search_regs.num_regs));      args_out_of_range (num, make_number (search_regs.num_regs));
# Line 2771  LIST should have been created by calling Line 2771  LIST should have been created by calling
2771                  XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer);                  XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer);
2772              }              }
2773    
2774            CHECK_NUMBER_COERCE_MARKER (marker, 0);            CHECK_NUMBER_COERCE_MARKER (marker);
2775            from = XINT (marker);            from = XINT (marker);
2776            list = Fcdr (list);            list = Fcdr (list);
2777    
# Line 2779  LIST should have been created by calling Line 2779  LIST should have been created by calling
2779            if (MARKERP (marker) && XMARKER (marker)->buffer == 0)            if (MARKERP (marker) && XMARKER (marker)->buffer == 0)
2780              XSETFASTINT (marker, 0);              XSETFASTINT (marker, 0);
2781    
2782            CHECK_NUMBER_COERCE_MARKER (marker, 0);            CHECK_NUMBER_COERCE_MARKER (marker);
2783            search_regs.start[i] = from;            search_regs.start[i] = from;
2784            search_regs.end[i] = XINT (marker);            search_regs.end[i] = XINT (marker);
2785          }          }
# Line 2842  DEFUN ("regexp-quote", Fregexp_quote, Sr Line 2842  DEFUN ("regexp-quote", Fregexp_quote, Sr
2842    register unsigned char *temp;    register unsigned char *temp;
2843    int backslashes_added = 0;    int backslashes_added = 0;
2844    
2845    CHECK_STRING (string, 0);    CHECK_STRING (string);
2846    
2847    temp = (unsigned char *) alloca (STRING_BYTES (XSTRING (string)) * 2);    temp = (unsigned char *) alloca (STRING_BYTES (XSTRING (string)) * 2);
2848    

Legend:
Removed from v.1.159  
changed lines
  Added in v.1.160

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26