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#21684: 25.0.50; undo in query-replace w/o exit Date: Wed, 14 Oct 2015 19:23:05 +0300 Organization: LINKOV.NET Message-ID: <87k2qpmna2.fsf@mail.linkov.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444840374 13861 80.91.229.3 (14 Oct 2015 16:32:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Oct 2015 16:32:54 +0000 (UTC) Cc: 21684@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 14 18:32:39 2015 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 1ZmOyj-0005Qw-9D for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Oct 2015 18:32:37 +0200 Original-Received: from localhost ([::1]:43501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmOyi-0004NY-K8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Oct 2015 12:32:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmOxF-0002zZ-Ac for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2015 12:31:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmOxD-0008CY-BQ for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2015 12:31:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmOxD-0008CU-9I for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2015 12:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZmOxD-0003v1-4K for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2015 12:31:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Oct 2015 16:31:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21684 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21684-submit@debbugs.gnu.org id=B21684.144484022415005 (code B ref 21684); Wed, 14 Oct 2015 16:31:03 +0000 Original-Received: (at 21684) by debbugs.gnu.org; 14 Oct 2015 16:30:24 +0000 Original-Received: from localhost ([127.0.0.1]:40473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZmOwY-0003tw-VK for submit@debbugs.gnu.org; Wed, 14 Oct 2015 12:30:23 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:39460 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZmOwW-0003th-BR for 21684@debbugs.gnu.org; Wed, 14 Oct 2015 12:30:21 -0400 Original-Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id A87837EC064; Wed, 14 Oct 2015 09:30:19 -0700 (PDT) Original-Received: from localhost.linkov.net (unknown [212.119.150.152]) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id CDA4B7EC061; Wed, 14 Oct 2015 09:30:18 -0700 (PDT) In-Reply-To: (Tino Calancha's message of "Wed, 14 Oct 2015 22:26:22 +0900 (JST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107609 Archived-At: > Quite often, performing query-replace, i just hit the [space] quicky > with no much attention. If i replace one string by mistake, i can > comeback to it with "^", but if i edit the string with "E" to reset it to > its original value, the interactive query-replace session ends. > > I found useful if we can undo such replacements without exiting the > query-replace. > > The attached patch implement such behaviour for `query-replace'. > Having this also working for `query-replace-regexp' would be very nice, > but harder to implement. This would be a useful feature. But I wonder why it's harder to implement for regexps? If you need, you could add all previous replacements strings to the same stack at the end of data elements in the stack like we did when necessary by adding new data at the end of the similar isearch stack elements in isearch-cmds. This would simplify restoring the previous replaced strings from the stack. PS: an alternative solution would be to call ordinary (undo) since perform-replace places undo boundaries with (undo-boundary), but it seems this would be a less reliable approach?