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#20070: 24.3; have commands such as downcase-region act on a rectangle region Date: Sun, 15 Mar 2015 22:34:02 +0200 Organization: LINKOV.NET Message-ID: <87h9tmov9h.fsf@mail.linkov.net> References: <87bnjyf29d.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426451845 19886 80.91.229.3 (15 Mar 2015 20:37:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Mar 2015 20:37:25 +0000 (UTC) Cc: =?UTF-8?Q?P=C3=A5l_?= =?UTF-8?Q?Gr=C3=B8n=C3=A5s?= Drange , 20070@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 15 21:37:14 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 1YXFHa-0003dT-Tr for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Mar 2015 21:37:11 +0100 Original-Received: from localhost ([::1]:44678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXFHa-0007PX-66 for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Mar 2015 16:37:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXFHV-0007M6-Tp for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2015 16:37:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXFHS-0007ND-Nx for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2015 16:37:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXFHS-0007N0-L0 for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2015 16:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YXFHS-0001xI-0L for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2015 16:37: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, 15 Mar 2015 20:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20070 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20070-submit@debbugs.gnu.org id=B20070.14264518037483 (code B ref 20070); Sun, 15 Mar 2015 20:37:01 +0000 Original-Received: (at 20070) by debbugs.gnu.org; 15 Mar 2015 20:36:43 +0000 Original-Received: from localhost ([127.0.0.1]:47424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXFH8-0001wd-UM for submit@debbugs.gnu.org; Sun, 15 Mar 2015 16:36:43 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:56380 helo=homiemail-a76.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXFH6-0001wQ-H4 for 20070@debbugs.gnu.org; Sun, 15 Mar 2015 16:36:41 -0400 Original-Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id BBF2345807B; Sun, 15 Mar 2015 13:36:39 -0700 (PDT) Original-Received: from localhost.linkov.net (85.253.48.94.cable.starman.ee [85.253.48.94]) (Authenticated sender: jurta@jurta.org) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPA id B8956458079; Sun, 15 Mar 2015 13:36:38 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sat, 14 Mar 2015 12:31:08 -0400") 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: 140.186.70.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:100505 Archived-At: > Indeed, same problem as kill-region, to which I had to add a `region' > argument (which basically says "we're called interactively so use > whatever is the region rather than BEG and END"). Then maybe support for the rectangular region should be introduced to every command by adding a new argument `region' with a list of pairs ((BEG1 . END1) (BEG2 . END2) ...) and keeping the existing arguments BEG and END unchanged? > Obviously, there will be many more commands that need to be adjusted to > the extended notion of "region" which can now be composed of various extents. > I'm not sure we need/want a new "R", because I think all cases of "r" > are currently broken when the region is non contiguous (i.e. they all > need to use "the new system"). > > One way to handle it generically, is to change call-interactively such > that when the argument is "r", the command is called once for each > "extent". Obviously, this won't work correctly for all cases, tho. Also this won't work for commands that use region-beginning/region-end in the interactive spec (like query-replace for bug#13178/bug#19829). So while fixing the commands one by one, after fixing every command it needs to be marked as "supporting the rectangular region". If the command used region-beginning and region-end, this means changing them to e.g. plural region-beginnings and region-ends. > Another option is to make "r" behave along the lines of your "R" (tho > I much prefer a list of pairs than a pair of lists, so one of the two > args would end up "useless"). Yes, the worst part of this feature is that commands should keep two existing arguments BEG and END, and either add a new meaning to them, (while supporting their current values as numbers for backward-compatibility), or add a new optional argument.