From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Lars Ingebrigtsen <larsi@gnus.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#27896: 25.2; `C-M-%' with `rectangle-mark-mode'
Date: Fri, 05 Feb 2021 12:58:33 +0100
Message-ID: <87pn1eiv4m.fsf@gnus.org>
References: <8b30a5cc-24db-4bca-94bd-50c79e65b43a@default>
 <cf0b64a5-dab3-4a71-b49b-fd9b20e77b41@default>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="6920"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cc: 27896@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
To: Drew Adams <drew.adams@oracle.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 05 12:59:26 2021
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1l7zll-0001h6-TP
	for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 12:59:25 +0100
Original-Received: from localhost ([::1]:33382 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1l7zlk-00020X-VZ
	for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 06:59:25 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37660)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1l7zlO-0001pp-9B
 for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 06:59:02 -0500
Original-Received: from debbugs.gnu.org ([209.51.188.43]:59691)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1l7zlO-00041R-1q
 for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 06:59:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1l7zlO-0005oO-0s
 for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 06:59:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Lars Ingebrigtsen <larsi@gnus.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Fri, 05 Feb 2021 11:59:01 +0000
Resent-Message-ID: <handler.27896.B27896.161252632722319@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 27896
X-GNU-PR-Package: emacs
Original-Received: via spool by 27896-submit@debbugs.gnu.org id=B27896.161252632722319
 (code B ref 27896); Fri, 05 Feb 2021 11:59:01 +0000
Original-Received: (at 27896) by debbugs.gnu.org; 5 Feb 2021 11:58:47 +0000
Original-Received: from localhost ([127.0.0.1]:43004 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1l7zl9-0005nv-Cc
 for submit@debbugs.gnu.org; Fri, 05 Feb 2021 06:58:47 -0500
Original-Received: from quimby.gnus.org ([95.216.78.240]:40440)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@gnus.org>) id 1l7zl7-0005nh-A7
 for 27896@debbugs.gnu.org; Fri, 05 Feb 2021 06:58:46 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=rBJJYlcaglJSSZN//0Lekm2P4igrVF2ivOCOIEj9la8=; b=HVP1W95FeZaMlNg9s3O0b/+yxV
 hDaVO6WJZsf9Lkl3UG6h3qKwTdM5rD6VwNNTrypMqmw8mgJrzTSScDM31JbhT3Dt7fFvgf7wcR/p8
 IEbvLPlvLHgJ5QYAruS5znOWYPGklOTwIjIAMHSWdADCh1LgoraOkkc4rdN01TfZvdN4=;
Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@gnus.org>)
 id 1l7zkw-00029y-Sr; Fri, 05 Feb 2021 12:58:38 +0100
X-Now-Playing: Mia Doi Todd's _Songbook_: "Pancho & Lefty"
In-Reply-To: <cf0b64a5-dab3-4a71-b49b-fd9b20e77b41@default> (Drew Adams's
 message of "Wed, 2 Aug 2017 15:22:26 -0700 (PDT)")
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.bugs:199361
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/199361>

Drew Adams <drew.adams@oracle.com> writes:

> The (normal) region limits the text that replacement search
> tries to match, by bounding it.  The rectangular region keeps
> the ordinary region as the domain of text that search tries
> to match, and it filters the matches against that domain to
> remove any matches that are not wholly within the limits of
> the rectangle.

Yup.  It's a pretty odd design decision, though -- I wonder whether it
this happened on purpose or whether that was just the simplest way to
implement this.

I've added Juri to the CCs; perhaps he can clarify.

(The problem is that if you ask to replace "foo.*bar", and you have

foo bar bar

then `query-replace' will match the entire line, and then filter out
that match (given that we have a rectangular region that covers just
"foo bar") and not replace anything.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no