[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/search.c
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/src/search.c |
Date: |
Tue, 04 Feb 2003 09:03:44 -0500 |
Index: emacs/src/search.c
diff -c emacs/src/search.c:1.171 emacs/src/search.c:1.172
*** emacs/src/search.c:1.171 Sun Nov 24 14:04:57 2002
--- emacs/src/search.c Tue Feb 4 09:03:13 2003
***************
*** 306,317 ****
}
re_match_object = Qnil;
!
i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2,
PT_BYTE - BEGV_BYTE, &search_regs,
ZV_BYTE - BEGV_BYTE);
immediate_quit = 0;
!
if (i == -2)
matcher_overflow ();
--- 306,317 ----
}
re_match_object = Qnil;
!
i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2,
PT_BYTE - BEGV_BYTE, &search_regs,
ZV_BYTE - BEGV_BYTE);
immediate_quit = 0;
!
if (i == -2)
matcher_overflow ();
***************
*** 390,396 ****
STRING_MULTIBYTE (string));
immediate_quit = 1;
re_match_object = string;
!
val = re_search (bufp, (char *) SDATA (string),
SBYTES (string), pos_byte,
SBYTES (string) - pos_byte,
--- 390,396 ----
STRING_MULTIBYTE (string));
immediate_quit = 1;
re_match_object = string;
!
val = re_search (bufp, (char *) SDATA (string),
SBYTES (string), pos_byte,
SBYTES (string) - pos_byte,
***************
*** 458,464 ****
0, STRING_MULTIBYTE (string));
immediate_quit = 1;
re_match_object = string;
!
val = re_search (bufp, (char *) SDATA (string),
SBYTES (string), 0,
SBYTES (string), 0);
--- 458,464 ----
0, STRING_MULTIBYTE (string));
immediate_quit = 1;
re_match_object = string;
!
val = re_search (bufp, (char *) SDATA (string),
SBYTES (string), 0,
SBYTES (string), 0);
***************
*** 550,556 ****
int allow_quit;
{
struct region_cache *newline_cache;
! int direction;
if (count > 0)
{
--- 550,556 ----
int allow_quit;
{
struct region_cache *newline_cache;
! int direction;
if (count > 0)
{
***************
*** 611,617 ****
ceiling_byte = min (tem, ceiling_byte);
{
! /* The termination address of the dumb loop. */
register unsigned char *ceiling_addr
= BYTE_POS_ADDR (ceiling_byte) + 1;
register unsigned char *cursor
--- 611,617 ----
ceiling_byte = min (tem, ceiling_byte);
{
! /* The termination address of the dumb loop. */
register unsigned char *ceiling_addr
= BYTE_POS_ADDR (ceiling_byte) + 1;
register unsigned char *cursor
***************
*** 856,862 ****
if (shortage == 0)
pos--;
!
return pos;
}
--- 856,862 ----
if (shortage == 0)
pos--;
!
return pos;
}
***************
*** 1062,1068 ****
s2 = 0;
}
re_match_object = Qnil;
!
while (n < 0)
{
int val;
--- 1062,1068 ----
s2 = 0;
}
re_match_object = Qnil;
!
while (n < 0)
{
int val;
***************
*** 1528,1534 ****
int infinity, limit, stride_for_teases = 0;
register int *BM_tab;
int *BM_tab_base;
! register unsigned char *cursor, *p_limit;
register int i, j;
unsigned char *pat, *pat_end;
int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
--- 1528,1534 ----
int infinity, limit, stride_for_teases = 0;
register int *BM_tab;
int *BM_tab_base;
! register unsigned char *cursor, *p_limit;
register int i, j;
unsigned char *pat, *pat_end;
int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
***************
*** 1561,1574 ****
/* a single test, a test for having gone past the end of the */
/* permissible match region, to test for both possible matches (when */
/* the stride goes past the end immediately) and failure to */
! /* match (where you get nudged past the end one stride at a time). */
/* Here we make a "mickey mouse" BM table. The stride of the search */
/* is determined only by the last character of the putative match. */
/* If that character does not match, we will stride the proper */
/* distance to propose a match that superimposes it on the last */
/* instance of a character that matches it (per trt), or misses */
! /* it entirely if there is none. */
dirlen = len_byte * direction;
infinity = dirlen - (lim_byte + pos_byte + len_byte + len_byte) * direction;
--- 1561,1574 ----
/* a single test, a test for having gone past the end of the */
/* permissible match region, to test for both possible matches (when */
/* the stride goes past the end immediately) and failure to */
! /* match (where you get nudged past the end one stride at a time). */
/* Here we make a "mickey mouse" BM table. The stride of the search */
/* is determined only by the last character of the putative match. */
/* If that character does not match, we will stride the proper */
/* distance to propose a match that superimposes it on the last */
/* instance of a character that matches it (per trt), or misses */
! /* it entirely if there is none. */
dirlen = len_byte * direction;
infinity = dirlen - (lim_byte + pos_byte + len_byte + len_byte) * direction;
***************
*** 1656,1662 ****
BM_tab[j] = dirlen - i;
/* A translation table is accompanied by its inverse -- see */
! /* comment following downcase_table for details */
if (this_translated)
{
int starting_ch = ch;
--- 1656,1662 ----
BM_tab[j] = dirlen - i;
/* A translation table is accompanied by its inverse -- see */
! /* comment following downcase_table for details */
if (this_translated)
{
int starting_ch = ch;
***************
*** 1844,1850 ****
/* This loop can be coded for space rather than */
/* speed because it will usually run only once. */
/* (the reach is at most len + 21, and typically */
! /* does not exceed len) */
while ((limit - pos_byte) * direction >= 0)
pos_byte += BM_tab[FETCH_BYTE (pos_byte)];
/* now run the same tests to distinguish going off the */
--- 1844,1850 ----
/* This loop can be coded for space rather than */
/* speed because it will usually run only once. */
/* (the reach is at most len + 21, and typically */
! /* does not exceed len) */
while ((limit - pos_byte) * direction >= 0)
pos_byte += BM_tab[FETCH_BYTE (pos_byte)];
/* now run the same tests to distinguish going off the */
***************
*** 1957,1963 ****
for (i = 0, i_byte = 0; i < len; )
{
int c;
!
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
if (SYNTAX (c) != Sword)
--- 1957,1963 ----
for (i = 0, i_byte = 0; i < len; )
{
int c;
!
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
if (SYNTAX (c) != Sword)
***************
*** 1992,1998 ****
{
int c;
int i_byte_orig = i_byte;
!
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
if (SYNTAX (c) == Sword)
--- 1992,1998 ----
{
int c;
int i_byte_orig = i_byte;
!
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
if (SYNTAX (c) == Sword)
***************
*** 2360,2366 ****
if (c == '\\')
{
FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
!
if (c == '&')
{
substart = search_regs.start[sub];
--- 2360,2366 ----
if (c == '\\')
{
FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
!
if (c == '&')
{
substart = search_regs.start[sub];
***************
*** 2593,2599 ****
/* Now move point "officially" to the start of the inserted replacement. */
move_if_not_intangible (newpoint);
!
return Qnil;
}
--- 2593,2599 ----
/* Now move point "officially" to the start of the inserted replacement. */
move_if_not_intangible (newpoint);
!
return Qnil;
}
***************
*** 2639,2645 ****
Lisp_Object subexp;
{
return match_limit (subexp, 0);
! }
DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 2, 0,
doc: /* Return a list containing all info on what the last search
matched.
--- 2639,2645 ----
Lisp_Object subexp;
{
return match_limit (subexp, 0);
! }
DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 2, 0,
doc: /* Return a list containing all info on what the last search
matched.
***************
*** 2687,2693 ****
last_thing_searched);
data[2 * i + 1] = Fmake_marker ();
Fset_marker (data[2 * i + 1],
! make_number (search_regs.end[i]),
last_thing_searched);
}
else
--- 2687,2693 ----
last_thing_searched);
data[2 * i + 1] = Fmake_marker ();
Fset_marker (data[2 * i + 1],
! make_number (search_regs.end[i]),
last_thing_searched);
}
else
***************
*** 2740,2746 ****
if (!CONSP (list) && !NILP (list))
list = wrong_type_argument (Qconsp, list);
! /* Unless we find a marker with a buffer in LIST, assume that this
match data came from a string. */
last_thing_searched = Qt;
--- 2740,2746 ----
if (!CONSP (list) && !NILP (list))
list = wrong_type_argument (Qconsp, list);
! /* Unless we find a marker with a buffer in LIST, assume that this
match data came from a string. */
last_thing_searched = Qt;
***************
*** 2809,2815 ****
list = Fcdr (list);
}
! return Qnil;
}
/* If non-zero the match data have been saved in saved_search_regs
--- 2809,2815 ----
list = Fcdr (list);
}
! return Qnil;
}
/* If non-zero the match data have been saved in saved_search_regs
***************
*** 2873,2879 ****
in = SDATA (string);
end = in + SBYTES (string);
! out = temp;
for (; in != end; in++)
{
--- 2873,2879 ----
in = SDATA (string);
end = in + SBYTES (string);
! out = temp;
for (; in != end; in++)
{
***************
*** 2890,2896 ****
out - temp,
STRING_MULTIBYTE (string));
}
!
void
syms_of_search ()
{
--- 2890,2896 ----
out - temp,
STRING_MULTIBYTE (string));
}
!
void
syms_of_search ()
{
- [Emacs-diffs] Changes to emacs/src/search.c,
Juanma Barranquero <=