From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#34525: replace-regexp missing some matches Date: Wed, 27 Feb 2019 10:40:19 -0500 Message-ID: References: <83lg2agt0j.fsf@gnu.org> <20190220213003.GC9655@ACM> <83bm35hkqo.fsf@gnu.org> <20190224173746.GA21808@ACM> <83mumlnk8y.fsf@gnu.org> <20190224210058.GB21808@ACM> <83mumjmxv6.fsf@gnu.org> <20190226135048.GA19653@ACM> <20190227142251.GB4772@ACM> <20190227150849.GC4772@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="65003"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: daniel.lopez999@gmail.com, 34525@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 27 16:42:04 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 1gz1LO-000Gnl-LX for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Feb 2019 16:42:02 +0100 Original-Received: from localhost ([127.0.0.1]:46251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gz1LN-0001JY-Hy for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Feb 2019 10:42:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gz1LE-0001JO-CZ for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2019 10:41:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gz1L5-0007Ac-7u for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2019 10:41:47 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gz1KQ-0006rQ-La; Wed, 27 Feb 2019 10:41:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gz1KQ-00014Q-E4; Wed, 27 Feb 2019 10:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 27 Feb 2019 15:41:02 +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.15512820244062 (code B ref 34525); Wed, 27 Feb 2019 15:41:02 +0000 Original-Received: (at 34525) by debbugs.gnu.org; 27 Feb 2019 15:40:24 +0000 Original-Received: from localhost ([127.0.0.1]:54162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gz1Jn-00013S-L5 for submit@debbugs.gnu.org; Wed, 27 Feb 2019 10:40:23 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:53691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gz1Jk-00013I-Rc for 34525@debbugs.gnu.org; Wed, 27 Feb 2019 10:40:22 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x1RFeJ7M020206; Wed, 27 Feb 2019 10:40:19 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 41BD4AE0E9; Wed, 27 Feb 2019 10:40:19 -0500 (EST) In-Reply-To: <20190227150849.GC4772@ACM> (Alan Mackenzie's message of "Wed, 27 Feb 2019 15:08:49 +0000") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6492=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6492> : inlines <7024> : streams <1814262> : uri <2803133> 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:155847 Archived-At: >> Here, in seeking the next interval, we go down a chain of `left's. We >> do not set the ->position field of these intervals, except for the last >> one, which we return. >> So the returned interval doesn't satisfy the condition that all its >> parents have their ->position's set correctly. [...] > I've done this, and it appears to have fixed the bug. :-) AFAICT the only place where we need the parents to have a valid ->position is in update_interval. So maybe another fix is to change update_interval so it computes the parent's ->position rather than rely on it having the right value. I personally don't have a preference and I'm not sure which option would be better performancewise. If we opt (like your patch does) to have the invariant that the ->position of parents is kept up-to-date, then maybe we should change find_interval to guarantee this (which would basically be a matter of moving the corresponding code from update_syntax_table where we update the parents's ->position after calling find_interval) ? Stefan