From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#27896: [External] : Re: bug#27896: 25.2; `C-M-%' with `rectangle-mark-mode' Date: Sun, 07 Feb 2021 20:58:39 +0200 Organization: LINKOV.NET Message-ID: <87eehrwyd8.fsf@mail.linkov.net> References: <8b30a5cc-24db-4bca-94bd-50c79e65b43a@default> <87pn1eiv4m.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31940"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: "27896@debbugs.gnu.org" <27896@debbugs.gnu.org>, Lars Ingebrigtsen To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 07 20:49:12 2021 Return-path: 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 ) id 1l8q3U-0008C0-KI for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Feb 2021 20:49:12 +0100 Original-Received: from localhost ([::1]:56488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8q3T-0000WO-Km for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Feb 2021 14:49:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8q3K-0000Ul-IA for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 14:49:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37344) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8q3K-00008m-BG for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 14:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l8q3K-0001hu-AB for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 14:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Feb 2021 19:49:02 +0000 Resent-Message-ID: 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.16127273376520 (code B ref 27896); Sun, 07 Feb 2021 19:49:02 +0000 Original-Received: (at 27896) by debbugs.gnu.org; 7 Feb 2021 19:48:57 +0000 Original-Received: from localhost ([127.0.0.1]:48884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8q3F-0001h6-6i for submit@debbugs.gnu.org; Sun, 07 Feb 2021 14:48:57 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:52205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8q3D-0001gq-3R for 27896@debbugs.gnu.org; Sun, 07 Feb 2021 14:48:56 -0500 X-Originating-IP: 91.129.108.204 Original-Received: from mail.gandi.net (m91-129-108-204.cust.tele2.ee [91.129.108.204]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 761391C0003; Sun, 7 Feb 2021 19:48:46 +0000 (UTC) In-Reply-To: (Drew Adams's message of "Fri, 5 Feb 2021 16:19:06 +0000") 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199555 Archived-At: >> > 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'm pretty sure it was done this way just because > that's much simpler to do. Indeed. A proper implementation would require too much changes in core code. Just imagine how to properly replace multi-line regexps in the rectangular region using current search functions. As a workaround, to imitate rectangular narrowing, you can copy the rectangular region with C-x r k to a temporary buffer, query-replace in it, and paste the result back with C-x r y.