From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#6808: 24.0.50; Incomplete match highlighting with `query-replace-regexp' Date: Fri, 6 Aug 2010 19:43:47 +0200 Message-ID: <201008061943.47792.tassilo@member.fsf.org> References: <878w4kqlw0.fsf@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1281118111 25395 80.91.229.12 (6 Aug 2010 18:08:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Aug 2010 18:08:31 +0000 (UTC) Cc: 6808@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 06 20:08:30 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OhRLJ-0000rv-IJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Aug 2010 20:08:29 +0200 Original-Received: from localhost ([127.0.0.1]:47061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhRLI-0006Ai-QK for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Aug 2010 14:08:28 -0400 Original-Received: from [140.186.70.92] (port=58060 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhRLA-00069E-SX for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2010 14:08:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OhRL8-00045L-DP for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2010 14:08:20 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50180) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhRL8-00045E-8h for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2010 14:08:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OhQxe-00078S-N7; Fri, 06 Aug 2010 13:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Aug 2010 17:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6808 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6808-submit@debbugs.gnu.org id=B6808.128111660227410 (code B ref 6808); Fri, 06 Aug 2010 17:44:02 +0000 Original-Received: (at 6808) by debbugs.gnu.org; 6 Aug 2010 17:43:22 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhQx0-000783-8K for submit@debbugs.gnu.org; Fri, 06 Aug 2010 13:43:22 -0400 Original-Received: from out1.smtp.messagingengine.com ([66.111.4.25]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhQwx-00077u-H3 for 6808@debbugs.gnu.org; Fri, 06 Aug 2010 13:43:20 -0400 Original-Received: from compute3.internal (compute3.internal [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id 743411A28CF; Fri, 6 Aug 2010 13:43:53 -0400 (EDT) Original-Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 06 Aug 2010 13:43:53 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:subject:date:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:message-id; s=smtpout; bh=mM50Xt/TP7Ym6um26RDTPOCHkeA=; b=hOt96cTjdh+xlHmvpkfsrVq2069s8N2OKDOBI9Y9m0dFB0BQ/ExOBd9aC9muY+ODah32KVwO+j63hVujEQtjf3KODlfKFFNn3fVqlXKAl6fFpkGYyywmsoY2Vos5ok7mIrsKooYwSak6MBdzkq3dvR7x7s+952J2uaVxQJbZB50= X-Sasl-enc: URdbStsufVFrmFcLpuidyVZPoD0Ans4nBAFVZo8bf9iO 1281116630 Original-Received: from thinkpad.localnet (p54AF1B7E.dip0.t-ipconnect.de [84.175.27.126]) by mail.messagingengine.com (Postfix) with ESMTPSA id 050D74E7B15; Fri, 6 Aug 2010 13:43:50 -0400 (EDT) User-Agent: KMail/1.13.5 (Linux/2.6.35-gentoo; KDE/4.4.5; x86_64; ; ) In-Reply-To: X-Face: `TY6r/ws=N5uqO1E`M=Sups<}n%T[E^o_?MJj List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39289 Archived-At: On Friday 06 August 2010 15:13:55 Stefan Monnier wrote: > > 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. To check your guess, I adviced that subr: (defadvice re-search-backward (before rsb-called activate) (message "re-search-backward was called")) Indeed, with that example above, for the 5 replacements that subr is called 25 times. I tried the same in an emacs without -Q, and although I had that incorrect highlighting at first, after typing the advice and evaling it, out of sudden it highlighted correctly... Another thing that is a bit strange (but it doesn't qualify as a bug) is that if you have point in the middle of the example, also matches before point are highlighted, although you won't reach them. Bye, Tassilo