GNU bug report logs - #73745
Add query-replace-reverse functions

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Dan Jacobson <jidanni@HIDDEN>; dated Fri, 11 Oct 2024 11:03:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 73745 <at> debbugs.gnu.org:


Received: (at 73745) by debbugs.gnu.org; 15 Oct 2024 06:29:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 15 02:29:34 2024
Received: from localhost ([127.0.0.1]:53260 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t0b3m-0007HV-JA
	for submit <at> debbugs.gnu.org; Tue, 15 Oct 2024 02:29:34 -0400
Received: from mslow1.mail.gandi.net ([217.70.178.240]:38149)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1t0b3k-0007HJ-93
 for 73745 <at> debbugs.gnu.org; Tue, 15 Oct 2024 02:29:33 -0400
Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198])
 by mslow1.mail.gandi.net (Postfix) with ESMTP id DBDE9C17AF
 for <73745 <at> debbugs.gnu.org>; Tue, 15 Oct 2024 06:20:21 +0000 (UTC)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 4015AC0005;
 Tue, 15 Oct 2024 06:19:59 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#73745: Add query-replace-reverse functions
In-Reply-To: <CADwFkmnkncMBreT9PwKRXiL6KwinmK_zKsEVwTbhG2UbyhPDWQ@HIDDEN>
 (Stefan Kangas's message of "Mon, 14 Oct 2024 21:32:56 +0000")
Organization: LINKOV.NET
References: <87plo6lxal.3.fsf@HIDDEN> <865xpua88o.fsf@HIDDEN>
 <CADwFkmnkncMBreT9PwKRXiL6KwinmK_zKsEVwTbhG2UbyhPDWQ@HIDDEN>
Date: Tue, 15 Oct 2024 09:17:08 +0300
Message-ID: <86r08h7uvv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 73745
Cc: 73745 <at> debbugs.gnu.org, Dan Jacobson <jidanni@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>> It is prompting with my previous action, but now I want to do the exact
>>> opposite,   `<h2 class="zz" → <h`
>>> No, I can't just put my (emacs -nw) cursor on top of the arrow and hit M-t.
>>
>> Some time ago we discussed 'M-t' to reverse 'from'/'to' parts.
>> But the problem is that for multi-word replacements
>> 'M-t' should still transpose words inside 'from' or 'to'
>> separately.
>>
>> All transpose keys ‘C-t’ (‘transpose-chars’), ‘M-t’
>> (‘transpose-words’), ‘C-M-t’ (‘transpose-sexps’), even ‘C-x C-t’
>> (‘transpose-lines’) for multi-line replacements -
>> all these keys can't be used to reverse 'from'/'to'.
>
> How about something like `C-c M-t`?

I see no other keys on the `C-c` keymap in the minibuffer:

  No commands with a binding that start with C-c.

OTOH, while reading a regexp for `C-M-%` there is:

  M-s c		read-regexp-toggle-case-fold

So maybe `M-s M-t` is not too bad.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73745; Package emacs. Full text available.

Message received at 73745 <at> debbugs.gnu.org:


Received: (at 73745) by debbugs.gnu.org; 14 Oct 2024 21:34:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 14 17:34:28 2024
Received: from localhost ([127.0.0.1]:44635 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t0Shw-0008Cf-Fg
	for submit <at> debbugs.gnu.org; Mon, 14 Oct 2024 17:34:28 -0400
Received: from mail-ed1-f50.google.com ([209.85.208.50]:48560)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1t0Sho-0008C7-0N
 for 73745 <at> debbugs.gnu.org; Mon, 14 Oct 2024 17:34:26 -0400
Received: by mail-ed1-f50.google.com with SMTP id
 4fb4d7f45d1cf-5c949d60d84so4189065a12.1
 for <73745 <at> debbugs.gnu.org>; Mon, 14 Oct 2024 14:34:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1728941577; x=1729546377; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=lgLkRS8zwtDQLu5AKFMhUD+ndpghqzPh1VbrRY9tcpY=;
 b=k/ACaLdZfcpS8Faat07js8kAiwofFatc4/1mZqQYJJXLnfk1oCicoo4mwLZOpXZAF5
 mcq3nm6RNS5YMLGYeJDDhbjpDizrMyDAfVeFRWFprwX3UHnY36GBVaQRxwH7oNs0mHVC
 IsAtJsBSAix9M97HyN6ks/kvzTe9co5g6CCcQCRUxciovxShuDJIpzv7ciu2UmQf+0wk
 zksGOp0bBLqvoXruFd8hH5AKmGEPK7YXZR9YXh/sxbSqnluFwCLPywxQbxR+RSqDeV4l
 oesAUK4XsEOQV85xvZpZ3UpPLF3TQb1n/tMxSFziCDccTmIcjKC3Y0vdhnmZFDLIlmbe
 WzAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728941577; x=1729546377;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=lgLkRS8zwtDQLu5AKFMhUD+ndpghqzPh1VbrRY9tcpY=;
 b=I9CYmD8qYMMZ2gg0bPWulWfLLmv25ujTr/wAg4iwkbfYwRI4CEKBm55y9/mMEqJII2
 wQyNwV95YOjKM4VxMGi0oGYPPzciMn1iGeMnzSHBio0+qDjBxr9yvidJikXyMGBGbnnM
 xRmco+DFOtkXvtkMhjnTkphH196hhPmiDyAn5xpEXk3mGZ4j/cQx9zGpINzhNoPzoDCt
 kU3f5QHQWUQWHcxTHKRxITuyYYM/Yu+AGHczYyN8fiu/H0t4+kpT79Y6H67Uwz9FjNO+
 ed/dQaerJyMOHCRNfG2PbodCvKZR0IWJdmgqMkrGjFgTCwQXcwwLPpWUzyx9V+mDT6ru
 DMbQ==
X-Gm-Message-State: AOJu0YwwnLdxMlcZDogjE9GU1QnXaqiG8YQOx1GOX4zX+nkq0WQpW0Oj
 EVrW6jfXrfRbJDiiKIzx/hwjmwyNVKN2N90G8JbCgmm3ujXFz4RyqH2hir3a/cuAalbi8Wl+USe
 TZOT//y83cvyJDck1nSsh1f1U4Rqt0g==
X-Google-Smtp-Source: AGHT+IF9b0pArhrRiv/ifwSSBlJIxowSF9SN/lX3KGQqXf29LCCHbKRHFMT/1Ha9mZKcMK7GwurgUjSh7aOXeF+XJEo=
X-Received: by 2002:a05:6402:43ce:b0:5c4:1320:e5a3 with SMTP id
 4fb4d7f45d1cf-5c948cd8df1mr9738040a12.16.1728941576743; Mon, 14 Oct 2024
 14:32:56 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Mon, 14 Oct 2024 21:32:56 +0000
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <865xpua88o.fsf@HIDDEN>
References: <87plo6lxal.3.fsf@HIDDEN> <865xpua88o.fsf@HIDDEN>
MIME-Version: 1.0
Date: Mon, 14 Oct 2024 21:32:56 +0000
Message-ID: <CADwFkmnkncMBreT9PwKRXiL6KwinmK_zKsEVwTbhG2UbyhPDWQ@HIDDEN>
Subject: Re: bug#73745: Add query-replace-reverse functions
To: Juri Linkov <juri@HIDDEN>, Dan Jacobson <jidanni@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73745
Cc: 73745 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Juri Linkov <juri@HIDDEN> writes:

>> It is prompting with my previous action, but now I want to do the exact
>> opposite,   `<h2 class=3D"zz" =E2=86=92 <h`
>> No, I can't just put my (emacs -nw) cursor on top of the arrow and hit M=
-t.
>
> Some time ago we discussed 'M-t' to reverse 'from'/'to' parts.
> But the problem is that for multi-word replacements
> 'M-t' should still transpose words inside 'from' or 'to'
> separately.
>
> All transpose keys =E2=80=98C-t=E2=80=99 (=E2=80=98transpose-chars=E2=80=
=99), =E2=80=98M-t=E2=80=99
> (=E2=80=98transpose-words=E2=80=99), =E2=80=98C-M-t=E2=80=99 (=E2=80=98tr=
anspose-sexps=E2=80=99), even =E2=80=98C-x C-t=E2=80=99
> (=E2=80=98transpose-lines=E2=80=99) for multi-line replacements -
> all these keys can't be used to reverse 'from'/'to'.

How about something like `C-c M-t`?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73745; Package emacs. Full text available.

Message received at 73745 <at> debbugs.gnu.org:


Received: (at 73745) by debbugs.gnu.org; 14 Oct 2024 17:49:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 14 13:49:52 2024
Received: from localhost ([127.0.0.1]:43999 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t0PCa-0004pF-7U
	for submit <at> debbugs.gnu.org; Mon, 14 Oct 2024 13:49:52 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48395)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1t0PCY-0004or-KP
 for 73745 <at> debbugs.gnu.org; Mon, 14 Oct 2024 13:49:50 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id AA3E960005;
 Mon, 14 Oct 2024 17:49:26 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dan Jacobson <jidanni@HIDDEN>
Subject: Re: bug#73745: Add query-replace-reverse functions
In-Reply-To: <87plo6lxal.3.fsf@HIDDEN> (Dan Jacobson's message of "Fri,
 11 Oct 2024 19:00:02 +0800")
Organization: LINKOV.NET
References: <87plo6lxal.3.fsf@HIDDEN>
Date: Mon, 14 Oct 2024 20:45:43 +0300
Message-ID: <865xpua88o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 73745
Cc: 73745 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> It is prompting with my previous action, but now I want to do the exact
> opposite,   `<h2 class="zz" → <h`
> No, I can't just put my (emacs -nw) cursor on top of the arrow and hit M-t.

Some time ago we discussed 'M-t' to reverse 'from'/'to' parts.
But the problem is that for multi-word replacements
'M-t' should still transpose words inside 'from' or 'to'
separately.

All transpose keys ‘C-t’ (‘transpose-chars’), ‘M-t’
(‘transpose-words’), ‘C-M-t’ (‘transpose-sexps’), even ‘C-x C-t’
(‘transpose-lines’) for multi-line replacements -
all these keys can't be used to reverse 'from'/'to'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73745; Package emacs. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 73745 <at> debbugs.gnu.org:


Received: (at 73745) by debbugs.gnu.org; 11 Oct 2024 13:08:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 11 09:08:58 2024
Received: from localhost ([127.0.0.1]:33753 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1szFO5-0001LF-Po
	for submit <at> debbugs.gnu.org; Fri, 11 Oct 2024 09:08:58 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1szFO3-0001Ky-NA
 for 73745 <at> debbugs.gnu.org; Fri, 11 Oct 2024 09:08:56 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1szFNl-0002wE-As; Fri, 11 Oct 2024 09:08:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=/4GzVCW+W//apTVDub3t33gMqr/P3Ddkb0dRSaz0hcI=; b=Jm7FX3o+VixndiuwrKw5
 9ecuka3CRl+HrTZDSHclWUcpwybyTa6E+US+F7+Qc6k/goABwFCW572Q05yEHTPhX6n1kM3h/DGXd
 GXEIyAIj8ElrrMRox2JVJUhdY3/WzLaKNO9kUEn/RRvu2NseHlJ2O/G/FSegRK+mSg9cqT6y8yFgz
 HfYqBhBBvVKs/xFEGVVdQhw9xEBa0dOTbNA/b136Loq1zNHgTpVOoY+sVsvl4JS51WkxlK9Nv0tH0
 udjWqw2N7zrUq6Ks7wDwJunNqshQnIZV8IzKSCXHvvHjNWXUBDOgs6PU7BfkV9r/amC5zKSpXG4RZ
 APA2rVcNrkfClw==;
Date: Fri, 11 Oct 2024 16:08:13 +0300
Message-Id: <86h69izt1e.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dan Jacobson <jidanni@HIDDEN>
In-Reply-To: <87plo6lxal.3.fsf@HIDDEN> (message from Dan Jacobson on Fri, 
 11 Oct 2024 19:00:02 +0800)
Subject: Re: bug#73745: Add query-replace-reverse functions
References: <87plo6lxal.3.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 73745
Cc: 73745 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Dan Jacobson <jidanni@HIDDEN>
> Date: Fri, 11 Oct 2024 19:00:02 +0800
> 
> I am looking at the M-% prompt:
> ```
> Query replace (default <h2 → <h2 class="zzz"): <h2 → <h2 class="zz"
> ```
> and I am wondering how to get it to do the reverse?

Type M-p or <UP> arrow twice.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73745; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Oct 2024 11:02:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 11 07:02:34 2024
Received: from localhost ([127.0.0.1]:33652 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1szDPl-00037R-Nz
	for submit <at> debbugs.gnu.org; Fri, 11 Oct 2024 07:02:34 -0400
Received: from lists.gnu.org ([209.51.188.17]:55380)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jidanni@HIDDEN>) id 1szDPj-00037K-VQ
 for submit <at> debbugs.gnu.org; Fri, 11 Oct 2024 07:02:32 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jidanni@HIDDEN>)
 id 1szDNO-0005E2-Pr
 for bug-gnu-emacs@HIDDEN; Fri, 11 Oct 2024 07:00:07 -0400
Received: from iguana.tulip.relay.mailchannels.net ([23.83.218.253])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jidanni@HIDDEN>)
 id 1szDNM-00052G-Uh
 for bug-gnu-emacs@HIDDEN; Fri, 11 Oct 2024 07:00:06 -0400
X-Sender-Id: dreamhost|x-authsender|jidanni@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id B90F9946C69
 for <bug-gnu-emacs@HIDDEN>; Fri, 11 Oct 2024 11:00:02 +0000 (UTC)
Received: from pdx1-sub0-mail-a220.dreamhost.com
 (trex-3.trex.outbound.svc.cluster.local [100.96.104.19])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 1EA58940467
 for <bug-gnu-emacs@HIDDEN>; Fri, 11 Oct 2024 11:00:02 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1728644402; a=rsa-sha256;
 cv=none;
 b=7UYjdvNJ8lslQ7uTFGvClCMmFbc7Po6Rd3Ds//sjjS93z0rMPLzD2bdQ5zHcP83BEryx8t
 eyXidyF1hfHs/Hpo/PMnhaywIxh7BkFOJdwXsZ6AjHrRMqtCVxBjAI+u1iYpy56Dbjb7nX
 Iy6EjD/eMPHE/azRRd/DF+NeaLWbsxZeJZPLHoPbuZwSHVris1PV05gGDiXbERxb526sEN
 6oTKMGy5V0w88c02Q185WpRtO0fPSflqk7nPa13cHlLWIV/Dt0nXZ2TwZr9vBBtthshiTi
 JJL2hNOg16LY8XBWeHUJees1KhzmGj409tXFXoec/tdHPjkBQbZfAI7TtWN0cw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1728644402;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:dkim-signature;
 bh=wGYjMi2Uy7UfXFcCjIU+kPTWxFbKNd0qu1POBYLy5/M=;
 b=TYtzsrzFgyLmuxNgi2G8YK8UszbiFNpkvQvK3rYt9Suxjk8TVYVl3/QFiVKdaGiAKTeQ9g
 pQeW5cRlBeRbnOlJIJRGknKbnzlnTelgk+Ridgv0zVtOPwD+wjG3hojO4MIKNpD+7tlV9S
 HfIDxuxS6QUpcpgovnjJD/l/A8LJ2q7PGcGkml3bU7tRThqGX+2qIsW81zdjE18z547PEA
 //FtjFjzOeiNxEP78EnRgz/MdgOMeX5DMnnyntUqCckkiE9DveovZcmG2bQZJFpDN2Ln6r
 uycvsUp8JD78rKdJocLF1+YYHOwCRM4vnsG0l/lvFtWWnYDxb3n0mbmU6q5bJw==
ARC-Authentication-Results: i=1; rspamd-667df746d9-j2nwt;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=jidanni@HIDDEN
X-Sender-Id: dreamhost|x-authsender|jidanni@HIDDEN
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Bored-Befitting: 6f5ef1503d054f21_1728644402534_2437690489
X-MC-Loop-Signature: 1728644402534:1186280213
X-MC-Ingress-Time: 1728644402533
Received: from pdx1-sub0-mail-a220.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.96.104.19 (trex/7.0.2); Fri, 11 Oct 2024 11:00:02 +0000
Received: from jidanni.org (1-165-168-153.dynamic-ip.hinet.net [1.165.168.153])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 (Authenticated sender: jidanni@HIDDEN)
 by pdx1-sub0-mail-a220.dreamhost.com (Postfix) with ESMTPSA id 4XQ3YY63tWz9t
 for <bug-gnu-emacs@HIDDEN>; Fri, 11 Oct 2024 04:00:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jidanni.org;
 s=dreamhost; t=1728644401;
 bh=wGYjMi2Uy7UfXFcCjIU+kPTWxFbKNd0qu1POBYLy5/M=;
 h=From:To:Subject:Date:Content-Type:Content-Transfer-Encoding;
 b=OTCi5hXmoSwkkUNkSgdA6zSIhBadzM4ptXLICvjKcX3TFm0hbxMNOiU4fW9SWn5Oc
 8FHH7liRc4FxK3ndUGeeIKemLyU+Nm6iV5FfHZZjja4Nplj5JviZCoELui0Jmh5E/9
 cXqfiZvTt8ldfJNO6uGJNoCR9Y3TYFvyVN4rX8lKeWpFawy7xaxMkZZvass451JI2I
 GOQ1P5olNP3UrBXZ/GRpwJOMvWH7UjClBZ1+0pBNohLFkfM7e9y/m1aNf2VLDXATBN
 niIwBfx3m+1T1wvmGXINsJc2RnlJ7rCRIGGyGl+xbEcpcwhjvRXhXjRl5LCQEgizJE
 7QaHJHpIzO2OA==
Received: from jidanni by jidanni.org with local (Exim 4.96)
 (envelope-from <jidanni@HIDDEN>) id 1szDNL-0002xX-0D
 for bug-gnu-emacs@HIDDEN; Fri, 11 Oct 2024 19:00:03 +0800
From: Dan Jacobson <jidanni@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Add query-replace-reverse functions
Date: Fri, 11 Oct 2024 19:00:02 +0800
Message-ID: <87plo6lxal.3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=23.83.218.253; envelope-from=jidanni@HIDDEN;
 helo=iguana.tulip.relay.mailchannels.net
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

I am looking at the M-% prompt:
```
Query replace (default <h2 → <h2 class="zzz"): <h2 → <h2 class="zz"
```
and I am wondering how to get it to do the reverse?

It is prompting with my previous action, but now I want to do the exact
opposite,   `<h2 class="zz" → <h`
No, I can't just put my (emacs -nw) cursor on top of the arrow and hit M-t.
https://stackoverflow.com/questions/39700435/emacs-query-replace-regexp-reverse-order-of-default#comment132667451_39705933
because my string is not so simple.

>Just hit the undo button.

I don't want to do an undo, I want to do a reverse query replace of my
previous query replace.

Wait. And then it dawned on me: emacs needs a
reverse-previous-query-replace function.

It would be just like query-replace, but using B -> A instead of A -> B.

And doing ESC p should march through the query replace history, but with
each pair reversed!

And same for query-replace-regexp. There needs to be a
reverse-query-replace-regexp too.

Or maybe call them query-replace-reverse, etc.




Acknowledgement sent to Dan Jacobson <jidanni@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#73745; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.