Subject: Re: bug#6808: 24.0.50; Incomplete match highlighting with `query-replace-regexp'

From: Stefan Monnier <[email-masked]>
Date: Fri, 06 Aug 2010 15:13:55 +0200

> The matches to be replaced by `query-replace-regexp' aren't highlighted
> completely, although the replacement is correct.

> Here's a recipe:

> 1. emacs -Q
> 2. Create a buffer with contents:

>  #1 153030 120 = 423988
>  #2 152845 181 = 1500234
>  #3 155160 247 = 767821
>  #4 155160 310 = 11131347
>  #5 155160 319 = 13979167

> 3. M-x query-replace-regexp RET [0-9]+ = RET RET

> Result:

> - The first match "120 =" is highlighted completely.
> - All further matches have only the last number highlighted, e.g. "1 =",
>   "7 =", ...
> - Performing the replacement replaces the correct, complete match,
>   e.g. "120 =", "181 =", "247 ="

I'd guess that those incorrect matches are search with
re-search-backward rather than re-search-forward.

        Stefan