From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#23484: 25.1.50; undo doesn't work properly in xref-query-replace-in-results Date: Sun, 08 May 2016 23:19:07 +0300 Organization: LINKOV.NET Message-ID: <87inyoxpz8.fsf@mail.linkov.net> References: <86d1owl682.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1462738886 7438 80.91.229.3 (8 May 2016 20:21:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 May 2016 20:21:26 +0000 (UTC) Cc: 23484@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 08 22:21:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1azVCS-00047S-3u for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 May 2016 22:21:12 +0200 Original-Received: from localhost ([::1]:38001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azVCR-0003lD-Bk for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 May 2016 16:21:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azVCN-0003hB-OH for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 16:21:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azVCI-0004cT-SL for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 16:21:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azVCI-0004cO-OW for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 16:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1azVCI-00045f-HQ for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 16:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 May 2016 20:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23484 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23484-submit@debbugs.gnu.org id=B23484.146273885415700 (code B ref 23484); Sun, 08 May 2016 20:21:02 +0000 Original-Received: (at 23484) by debbugs.gnu.org; 8 May 2016 20:20:54 +0000 Original-Received: from localhost ([127.0.0.1]:43530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azVCA-000459-DE for submit@debbugs.gnu.org; Sun, 08 May 2016 16:20:54 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:52316 helo=homiemail-a76.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azVC7-000451-Vi for 23484@debbugs.gnu.org; Sun, 08 May 2016 16:20:52 -0400 Original-Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id F170E45807C; Sun, 8 May 2016 13:20:50 -0700 (PDT) Original-Received: from localhost.linkov.net (85.253.58.148.cable.starman.ee [85.253.58.148]) (Authenticated sender: jurta@jurta.org) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPA id 205F145807B; Sun, 8 May 2016 13:20:49 -0700 (PDT) In-Reply-To: <86d1owl682.fsf@yandex.ru> (Dmitry Gutov's message of "Sun, 08 May 2016 22:06:37 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (x86_64-pc-linux-gnu) 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: 208.118.235.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:118002 Archived-At: > 1. Do a search that has several matches in one buffer, e.g. using > dired-do-find-regexp. > 2. Press `r' in the *xref* buffer, to initiate replacement. Input `.*' > and `abcd', for instance. This value of FROM is important. > 3. Replace a couple then undo that (press y, y, u, u). > 4. Try agreeing with the subsequent prompts. The replacements performed > then will be wrong. > > I've tried to come up with a patch but stopped short of really delving > into the code of perform-replace. Which seems really necessary at this > point. Attaching what I already have. I can't reproduce this when using normal query-replace. Is this caused by binding local variables in xref--query-replace-1? Then maybe there is a better way to achieve the same. > The big problem is that perform-replace does not consistently use > replace-re-search-function. With the new undo code, it's became worse. > After you press `u', it seems to switch to moving around the saved match > data stack and using a plain looking-at, without checking with > isearch-filter-predicate. You don't need isearch-filter-predicate when doing undo because a previous replacement already checked it, no?