From: Stefan Monnier Date: Thu, 25 May 2000 16:32:19 +0000 (+0000) Subject: (at_begline_loc_p): Also recognize the \\(?:^ case X-Git-Tag: emacs-pretest-21.0.90~3715 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d2af47dfec36a1b8f2a952cf837088078b8faedc;p=emacs.git (at_begline_loc_p): Also recognize the \\(?:^ case of an anchor at the beginning of a shy-group. --- diff --git a/src/ChangeLog b/src/ChangeLog index f6ae2321c2a..555c2ca749e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2000-05-25 Stefan Monnier + + * regex.c (at_begline_loc_p): Also recognize the \\(?:^ case + of an anchor at the beginning of a shy-group. + 2000-05-25 Gerd Moellmann * xdisp.c (handle_invisible_prop): Don't try to skip over diff --git a/src/regex.c b/src/regex.c index 3b4eb502596..9ea8699c331 100644 --- a/src/regex.c +++ b/src/regex.c @@ -3208,7 +3208,12 @@ at_begline_loc_p (pattern, p, syntax) /* After a subexpression? */ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) /* After an alternative? */ - || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); + || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)) + /* After a shy subexpression? */ + || ((syntax & RE_SHY_GROUPS) && prev - 2 >= pattern + && prev[-1] == '?' && prev[-2] == '(' + && (syntax & RE_NO_BK_PARENS + || (prev - 3 >= pattern && prev[-3] == '\\'))); }