From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#34525: replace-regexp missing some matches Date: Mon, 18 Feb 2019 21:10:26 +0000 Message-ID: <20190218211026.GD11724@ACM> References: <5a74a337-804e-2590-bffd-43a851f90240@gmail.com> <83zhqtjdtz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="79902"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Daniel Lopez , 34525@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 18 22:15:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvqFq-000Ke4-UR for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 22:15:11 +0100 Original-Received: from localhost ([127.0.0.1]:36761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvqFp-0000rz-Pm for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 16:15:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvqFj-0000rt-Da for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 16:15:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvqFi-0002Qx-FB for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 16:15:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvqFi-0002QV-69; Mon, 18 Feb 2019 16:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gvqFh-0007No-Vz; Mon, 18 Feb 2019 16:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 18 Feb 2019 21:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34525 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 34525-submit@debbugs.gnu.org id=B34525.155052444728246 (code B ref 34525); Mon, 18 Feb 2019 21:15:01 +0000 Original-Received: (at 34525) by debbugs.gnu.org; 18 Feb 2019 21:14:07 +0000 Original-Received: from localhost ([127.0.0.1]:53285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvqEo-0007LW-NQ for submit@debbugs.gnu.org; Mon, 18 Feb 2019 16:14:07 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:58883 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gvqEm-0007LJ-EL for 34525@debbugs.gnu.org; Mon, 18 Feb 2019 16:14:05 -0500 Original-Received: (qmail 55429 invoked by uid 3782); 18 Feb 2019 21:14:01 -0000 Original-Received: from acm.muc.de (p4FE15EC7.dip0.t-ipconnect.de [79.225.94.199]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 18 Feb 2019 22:13:59 +0100 Original-Received: (qmail 14614 invoked by uid 1000); 18 Feb 2019 21:10:26 -0000 Content-Disposition: inline In-Reply-To: <83zhqtjdtz.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155517 Archived-At: Hello, again. On Mon, Feb 18, 2019 at 17:50:16 +0200, Eli Zaretskii wrote: > > From: Daniel Lopez > > Date: Mon, 18 Feb 2019 08:28:35 +0000 > > - Start "emacs -Q" and open the file BitmapFontFace.h > > - Evaluate the expression (replace-regexp "\\" "SharedBitmap") > > - The text "Replaced 8 occurrences" appears in the echo area. > > Problem: > > There were actually 12 occurrences (ie. of the word "Bitmap" surrounded > > by word boundaries) in the file that should have been replaced. If I now > > move point back to the start of the buffer and evaluate the expression > > again, it says "Replaced 4 occurrences". > > The exact number of incorrect replacements perhaps varies over time. > > That is, I can test it five times in a row and get 8 initial replacments > > each time, but after trying some other search terms, messing with the > > file, restarting Emacs etc, I try my initial test again and then maybe > > it consistently replaces 10 the first time, for a while. So your exact > > numbers may vary. > C++ Mode plays some funky games with the syntax of '<', so maybe this > is the consequence. CC'ing Alan, in the hope that he might have > something interesting to say about this. I built a version of CC Mode with the use of the category properties on < and > disabled. This version used straight syntax-table text properties instead. The bug still happened. So, although I should probably get rid of this too "clever" use of category properties, they seem not to be the cause of this bug. > Thanks. -- Alan Mackenzie (Nuremberg, Germany).