comparison src/search.c @ 56294:aaa6a4ecea38

(match_limit, Fmatch_data, Fset_match_data): YAILOM.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 30 Jun 2004 19:34:34 +0000
parents b04610e283ce
children 65eb0cb0f21f 6f6e9fe4658b
comparison
equal deleted inserted replaced
56293:f27d5d17fde5 56294:aaa6a4ecea38
1 /* String search routines for GNU Emacs. 1 /* String search routines for GNU Emacs.
2 Copyright (C) 1985, 86,87,93,94,97,98, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 86,87,93,94,97,98, 1999, 2004
3 Free Software Foundation, Inc.
3 4
4 This file is part of GNU Emacs. 5 This file is part of GNU Emacs.
5 6
6 GNU Emacs is free software; you can redistribute it and/or modify 7 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
2626 register int n; 2627 register int n;
2627 2628
2628 CHECK_NUMBER (num); 2629 CHECK_NUMBER (num);
2629 n = XINT (num); 2630 n = XINT (num);
2630 if (n < 0) 2631 if (n < 0)
2631 args_out_of_range (num, 0); 2632 args_out_of_range (num, make_number (0));
2632 if (search_regs.num_regs <= 0) 2633 if (search_regs.num_regs <= 0)
2633 error ("No match data, because no search succeeded"); 2634 error ("No match data, because no search succeeded");
2634 if (n >= search_regs.num_regs 2635 if (n >= search_regs.num_regs
2635 || search_regs.start[n] < 0) 2636 || search_regs.start[n] < 0)
2636 return Qnil; 2637 return Qnil;
2726 } 2727 }
2727 else 2728 else
2728 data[2 * i] = data [2 * i + 1] = Qnil; 2729 data[2 * i] = data [2 * i + 1] = Qnil;
2729 } 2730 }
2730 2731
2731 if (BUFFERP(last_thing_searched) 2732 if (BUFFERP (last_thing_searched) && !NILP (integers))
2732 && ! NILP (integers)) 2733 {
2733 { 2734 data[len] = last_thing_searched;
2734 XSETBUFFER(data[len], last_thing_searched);
2735 len++; 2735 len++;
2736 } 2736 }
2737 2737
2738 /* If REUSE is not usable, cons up the values and return them. */ 2738 /* If REUSE is not usable, cons up the values and return them. */
2739 if (! CONSP (reuse)) 2739 if (! CONSP (reuse))
2809 } 2809 }
2810 2810
2811 for (i = 0;; i++) 2811 for (i = 0;; i++)
2812 { 2812 {
2813 marker = Fcar (list); 2813 marker = Fcar (list);
2814 if (BUFFERP(marker)) 2814 if (BUFFERP (marker))
2815 { 2815 {
2816 XSETBUFFER(last_thing_searched, marker); 2816 last_thing_searched = marker;
2817 break; 2817 break;
2818 } 2818 }
2819 if (i >= length) 2819 if (i >= length)
2820 break; 2820 break;
2821 if (NILP (marker)) 2821 if (NILP (marker))