From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 09 22:19:58 2015 Received: (at submit) by debbugs.gnu.org; 10 Mar 2015 02:19:58 +0000 Received: from localhost ([127.0.0.1]:41091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YV9m1-0001TG-Di for submit@debbugs.gnu.org; Mon, 09 Mar 2015 22:19:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39507) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YV8d5-0006gJ-Rv for submit@debbugs.gnu.org; Mon, 09 Mar 2015 21:06:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YV8cz-0004oR-Dd for submit@debbugs.gnu.org; Mon, 09 Mar 2015 21:06:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV8cz-0004oL-Ap for submit@debbugs.gnu.org; Mon, 09 Mar 2015 21:06:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV8cy-0004WA-96 for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2015 21:06:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YV8cx-0004nt-BZ for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2015 21:06:32 -0400 Received: from mail-ie0-x231.google.com ([2607:f8b0:4001:c03::231]:39390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV8cx-0004nZ-6p for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2015 21:06:31 -0400 Received: by iecat20 with SMTP id at20so55097757iec.6 for ; Mon, 09 Mar 2015 18:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=KAg6QMfLj0xJeCr66a/uOjdVpP4a46wd3fIIOeLN5B8=; b=UdcuZ9d9ix1iGcswpj1JPzX81N/+mNJYuYNjzGQFCGkOsgQnHmOalIA6zLGMSDHzUS 1OxGfq9jWZZRTA/rsVo9DWloTibcxidwh7nyZiIpuZUvA107z80prlVguXKxNm5p827S Ri7C0dYZ5GH/y0vmWWJMkugrHWU6hk+rGNAljVsn+AeKZxstmphuzcH/JfDHkzUF0ZE7 Wg5N4THVuXS5jiar8txP6D/yx7PNiK3bExbFp4wFgjbWQmAlEHlIYqaZSt65E1J/0hZs QC091Gft+1zmER05ukUfuU9na6/QUpOmA6t08orusPc+7zkmxDH0c4mmld0NkIIFkKbP EoWQ== MIME-Version: 1.0 X-Received: by 10.42.250.208 with SMTP id mp16mr31264494icb.10.1425949589967; Mon, 09 Mar 2015 18:06:29 -0700 (PDT) Received: by 10.50.228.171 with HTTP; Mon, 9 Mar 2015 18:06:29 -0700 (PDT) Date: Tue, 10 Mar 2015 12:06:29 +1100 Message-ID: Subject: 24.3; have commands such as downcase-region act on a rectangle region From: =?UTF-8?B?UMOlbCBHcsO4bsOlcyBEcmFuZ2U=?= To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=20cf3010e58bc719fb0510e4c25c X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 09 Mar 2015 22:19:55 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --20cf3010e58bc719fb0510e4c25c Content-Type: text/plain; charset=UTF-8 downcase-region in marked rectangle does not downcase entire rectangle and downcases things not marked: On the following content in my buffer (*scratch*), upon marking the inner rectangle consisting of "FG" and "JK" using C-return (cua-mode enabled) ABCD EFGH IJKL MNOP Applying `downcase-region` yields the following unexpected result: ABCD Efgh ijKL MNOP I would expect "fg" and "jk" to be downcased, and not "fgh" and "ij". Original report at http://emacs.stackexchange.com/q/9913/5154 --20cf3010e58bc719fb0510e4c25c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
downcase-region in marked rectangle does not downcase enti= re rectangle
and downcases things not marked:

On the following co= ntent in my buffer (*scratch*), upon marking the
inner rectangle consist= ing of "FG" and "JK" using C-return (cua-mode
enable= d)

=C2=A0=C2=A0=C2=A0 ABCD
=C2=A0=C2=A0=C2=A0 EFGH
=C2=A0=C2= =A0=C2=A0 IJKL
=C2=A0=C2=A0=C2=A0 MNOP

Applying `downcase-region`= yields the following unexpected result:

=C2=A0=C2=A0=C2=A0 ABCD
= =C2=A0=C2=A0=C2=A0 Efgh
=C2=A0=C2=A0=C2=A0 ijKL
=C2=A0=C2=A0=C2=A0 MN= OP

I would expect "fg" and "jk" to be downcased,= and not "fgh" and "ij".

Original report at http://emacs.stackexchan= ge.com/q/9913/5154

--20cf3010e58bc719fb0510e4c25c-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 11 16:28:32 2015 Received: (at 20070) by debbugs.gnu.org; 11 Mar 2015 20:28:32 +0000 Received: from localhost ([127.0.0.1]:43175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVnF1-0004Mj-Ta for submit@debbugs.gnu.org; Wed, 11 Mar 2015 16:28:32 -0400 Received: from mercure.iro.umontreal.ca ([132.204.24.67]:39690) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVnEy-0004MS-Ub for 20070@debbugs.gnu.org; Wed, 11 Mar 2015 16:28:29 -0400 Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 8E5FC85F60; Wed, 11 Mar 2015 16:28:27 -0400 (EDT) Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 879381E5B74; Wed, 11 Mar 2015 16:28:03 -0400 (EDT) Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 6A6B8B4102; Wed, 11 Mar 2015 16:28:03 -0400 (EDT) From: Stefan Monnier To: =?windows-1252?B?UOVsIEdy+G7lcw==?= Drange Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Message-ID: References: Date: Wed, 11 Mar 2015 16:28:03 -0400 In-Reply-To: (=?windows-1252?B?IlDlbCBHcvhu5XM=?= Drange"'s message of "Tue, 10 Mar 2015 12:06:29 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.6, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_MONNAIE 0.22, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-Spam-Status: No X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20070 Cc: 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) While this is not the same bug as bug#19829, it's fundamentally the same issue, and they should be fixed in the same way. Stefan >>>>> "P=E5l" =3D=3D P=E5l Gr=F8n=E5s Drange writes: > downcase-region in marked rectangle does not downcase entire rectangle > and downcases things not marked: > On the following content in my buffer (*scratch*), upon marking the > inner rectangle consisting of "FG" and "JK" using C-return (cua-mode > enabled) > ABCD > EFGH > IJKL > MNOP > Applying `downcase-region` yields the following unexpected result: > ABCD > Efgh > ijKL > MNOP > I would expect "fg" and "jk" to be downcased, and not "fgh" and "ij". > Original report at http://emacs.stackexchange.com/q/9913/5154 From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 12 15:29:03 2015 Received: (at 20070) by debbugs.gnu.org; 12 Mar 2015 19:29:03 +0000 Received: from localhost ([127.0.0.1]:44259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YW8n0-0001jS-LA for submit@debbugs.gnu.org; Thu, 12 Mar 2015 15:29:03 -0400 Received: from ps18281.dreamhost.com ([69.163.222.226]:54067 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YW8mv-0001im-CT for 20070@debbugs.gnu.org; Thu, 12 Mar 2015 15:29:00 -0400 Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D01B039524D769; Thu, 12 Mar 2015 12:28:55 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Organization: LINKOV.NET References: Date: Thu, 12 Mar 2015 21:23:58 +0200 In-Reply-To: (Stefan Monnier's message of "Wed, 11 Mar 2015 16:28:03 -0400") Message-ID: <87bnjyf29d.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20070 Cc: =?iso-8859-1?Q?P=E5l_Gr=F8n=E5s?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > While this is not the same bug as bug#19829, it's fundamentally the same > issue, and they should be fixed in the same way. Currently, `downcase-region' is defined with the interactive spec 'r' that calls the function with point and mark as 2 args. For backward-compatibility reasons this can't be changed. So maybe a new interactive spec e.g. 'R' should call the function with 2 lists where the first list will contain a list of beginnings of all intervals in the rectangular region, and the second list of endings of intervals? Then a command using it will need to add another outermost loop to pop interval boundaries from both list arguments `begs' and `ends' to process intervals using the same logic like it processes a single region now. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 12:31:13 2015 Received: (at 20070) by debbugs.gnu.org; 14 Mar 2015 16:31:13 +0000 Received: from localhost ([127.0.0.1]:46753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YWoy1-0003zB-4q for submit@debbugs.gnu.org; Sat, 14 Mar 2015 12:31:13 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:57009) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YWoxy-0003z2-CJ for 20070@debbugs.gnu.org; Sat, 14 Mar 2015 12:31:11 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lRFxLnr/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqBZlfjhqBeYFFIoIygVgignMBAQE X-IPAS-Result: ArsTAPOG1lRFxLnr/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqBZlfjhqBeYFFIoIygVgignMBAQE X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113553961" Received: from 69-196-185-235.dsl.teksavvy.com (HELO pastel.home) ([69.196.185.235]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Mar 2015 12:31:08 -0400 Received: by pastel.home (Postfix, from userid 20848) id 9C1C0D40; Sat, 14 Mar 2015 12:31:08 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Message-ID: References: <87bnjyf29d.fsf@mail.linkov.net> Date: Sat, 14 Mar 2015 12:31:08 -0400 In-Reply-To: <87bnjyf29d.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 12 Mar 2015 21:23:58 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20070 Cc: =?windows-1252?B?UOVsIEdy+G7lcw==?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Currently, `downcase-region' is defined with the interactive spec 'r' > that calls the function with point and mark as 2 args. 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"). > For backward-compatibility reasons this can't be changed. So maybe > a new interactive spec e.g. 'R' should call the function with 2 lists > where the first list will contain a list of beginnings of all intervals > in the rectangular region, and the second list of endings of intervals? 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. 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"). > Then a command using it will need to add another outermost loop to pop > interval boundaries from both list arguments `begs' and `ends' to process > intervals using the same logic like it processes a single region now. Indeed. Maybe such a loop would be common enough that it'd be worthwhile adding some ad-hoc handling (e.g. make call-interactively do the looping as suggested above, tho maybe only after checking some special property of the command). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 15 16:36:43 2015 Received: (at 20070) by debbugs.gnu.org; 15 Mar 2015 20:36:43 +0000 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 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 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) 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) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Organization: LINKOV.NET References: <87bnjyf29d.fsf@mail.linkov.net> Date: Sun, 15 Mar 2015 22:34:02 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 14 Mar 2015 12:31:08 -0400") Message-ID: <87h9tmov9h.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20070 Cc: =?iso-8859-1?Q?P=E5l_Gr=F8n=E5s?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 15 16:42:16 2015 Received: (at 20070) by debbugs.gnu.org; 15 Mar 2015 20:42:16 +0000 Received: from localhost ([127.0.0.1]:47429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXFMV-00025h-UY for submit@debbugs.gnu.org; Sun, 15 Mar 2015 16:42:16 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:44206) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXFMS-00025X-U0 for 20070@debbugs.gnu.org; Sun, 15 Mar 2015 16:42:14 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NL900400TAD3Q00@mtaout26.012.net.il> for 20070@debbugs.gnu.org; Sun, 15 Mar 2015 22:42:55 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NL900KTBTJJGR80@mtaout26.012.net.il>; Sun, 15 Mar 2015 22:42:55 +0200 (IST) Date: Sun, 15 Mar 2015 22:41:55 +0200 From: Eli Zaretskii Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region In-reply-to: <87h9tmov9h.fsf@mail.linkov.net> X-012-Sender: halo1@inter.net.il To: Juri Linkov Message-id: <83h9tm0z8s.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20070 Cc: paal.drange@gmail.com, 20070@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Juri Linkov > Date: Sun, 15 Mar 2015 22:34:02 +0200 > Cc: Pål Grønås Drange > , 20070@debbugs.gnu.org > > > 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? What are BEG1, END1, BEG2, END2, etc. values here? In what units are they measured? Are they pixels, are they columns, something else? From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 16 07:48:25 2015 Received: (at 20070) by debbugs.gnu.org; 16 Mar 2015 11:48:25 +0000 Received: from localhost ([127.0.0.1]:48165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXTVQ-0002My-MH for submit@debbugs.gnu.org; Mon, 16 Mar 2015 07:48:25 -0400 Received: from mxin.ulb.ac.be ([164.15.128.112]:7345) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXTVN-0002Mo-J9 for 20070@debbugs.gnu.org; Mon, 16 Mar 2015 07:48:22 -0400 Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 16 Mar 2015 12:48:20 +0100 From: Nicolas Richard To: Eli Zaretskii Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <83h9tm0z8s.fsf@gnu.org> Date: Mon, 16 Mar 2015 12:49:17 +0100 In-Reply-To: <83h9tm0z8s.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 15 Mar 2015 22:41:55 +0200") Message-ID: <87oant88n6.fsf@yahoo.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20070 Cc: paal.drange@gmail.com, 20070@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Eli Zaretskii writes: > What are BEG1, END1, BEG2, END2, etc. values here? In what units are > they measured? Are they pixels, are they columns, something else? Couldn't they be markers ? I think it's the easiest to work with, in the case the text changes. -- Nico From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 16 09:14:34 2015 Received: (at 20070) by debbugs.gnu.org; 16 Mar 2015 13:14:34 +0000 Received: from localhost ([127.0.0.1]:48222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXUqn-0004Wb-Oh for submit@debbugs.gnu.org; Mon, 16 Mar 2015 09:14:34 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:16593) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXUqm-0004WU-Fq for 20070@debbugs.gnu.org; Mon, 16 Mar 2015 09:14:32 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lQXW5EB/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqAQSrNyKCMoFYIoJzAQEB X-IPAS-Result: ArsTAPOG1lQXW5EB/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqAQSrNyKCMoFYIoJzAQEB X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113672699" Received: from 23-91-145-1.cpe.pppoe.ca (HELO pastel.home) ([23.91.145.1]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Mar 2015 09:14:31 -0400 Received: by pastel.home (Postfix, from userid 20848) id D9540F89; Mon, 16 Mar 2015 09:14:31 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Message-ID: References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <83h9tm0z8s.fsf@gnu.org> Date: Mon, 16 Mar 2015 09:14:31 -0400 In-Reply-To: <83h9tm0z8s.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 15 Mar 2015 22:41:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20070 Cc: paal.drange@gmail.com, 20070@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > What are BEG1, END1, BEG2, END2, etc. values here? Buffer positions. These are needed for the new non-contiguous notion of region introduced by rectangles (and which could be used for other notions of selections, e.g. the recently mentioned "inverse region"). Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 16 09:19:14 2015 Received: (at 20070) by debbugs.gnu.org; 16 Mar 2015 13:19:14 +0000 Received: from localhost ([127.0.0.1]:48226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXUvK-0004eS-EW for submit@debbugs.gnu.org; Mon, 16 Mar 2015 09:19:14 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:59563) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXUvI-0004eL-S5 for 20070@debbugs.gnu.org; Mon, 16 Mar 2015 09:19:13 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lQXW5EB/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqBas3IoIygVgignMBAQE X-IPAS-Result: ArsTAPOG1lQXW5EB/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqBas3IoIygVgignMBAQE X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113673092" Received: from 23-91-145-1.cpe.pppoe.ca (HELO pastel.home) ([23.91.145.1]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Mar 2015 09:19:12 -0400 Received: by pastel.home (Postfix, from userid 20848) id 2DDCDF89; Mon, 16 Mar 2015 09:19:12 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Message-ID: References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> Date: Mon, 16 Mar 2015 09:19:12 -0400 In-Reply-To: <87h9tmov9h.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 15 Mar 2015 22:34:02 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20070 Cc: =?windows-1252?B?UOVsIEdy+G7lcw==?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> 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). Of course, I don't think we can handle those commands without manual changes. > If the command used region-beginning and region-end, this means > changing them to e.g. plural region-beginnings and region-ends. Here again, I'd rather use a list of pairs than a pair of lists, so we wouldn't want to have 2 functions (one to get the list of beginnings and another to get the list of ends). Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 16 17:04:24 2015 Received: (at 20070) by debbugs.gnu.org; 16 Mar 2015 21:04:24 +0000 Received: from localhost ([127.0.0.1]:48990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXcBT-0002Tl-1M for submit@debbugs.gnu.org; Mon, 16 Mar 2015 17:04:24 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:53581 helo=homiemail-a12.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXcBQ-0002Tc-Mv for 20070@debbugs.gnu.org; Mon, 16 Mar 2015 17:04:21 -0400 Received: from homiemail-a12.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTP id E05221030063; Mon, 16 Mar 2015 14:04:19 -0700 (PDT) Received: from localhost.linkov.net (85.253.154.98.cable.starman.ee [85.253.154.98]) (Authenticated sender: jurta@jurta.org) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTPA id AEA0D1030062; Mon, 16 Mar 2015 14:04:18 -0700 (PDT) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Organization: LINKOV.NET References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <83h9tm0z8s.fsf@gnu.org> Date: Mon, 16 Mar 2015 22:55:36 +0200 In-Reply-To: <83h9tm0z8s.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 15 Mar 2015 22:41:55 +0200") Message-ID: <87sid4r7av.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20070 Cc: paal.drange@gmail.com, 20070@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > What are BEG1, END1, BEG2, END2, etc. values here? They should have the same type as the return values of region-beginning/region-end and the interactive space "r" which are of the marker type. So the patch in bug#19829 should be improved by another patch (both will be installed after finishing designing this feature): diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 044939f..a314d33 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -676,9 +676,9 @@ (defun cua--extract-rectangle-positions () (lambda (s e l r _v) (goto-char s) (move-to-column l) - (setq s (point)) + (setq s (point-marker)) (move-to-column r) - (setq e (point)) + (setq e (point-marker)) (setq rect (cons (cons s e) rect))))) (nreverse rect))) diff --git a/lisp/rect.el b/lisp/rect.el index 271f720..7a2c5a3 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -265,7 +265,8 @@ (defun extract-rectangle-positions (start end) (apply-on-rectangle (lambda (startcol endcol) (move-to-column startcol) - (push (cons (prog1 (point) (move-to-column endcol)) (point)) + (push (cons (prog1 (point-marker) (move-to-column endcol)) + (point-marker)) positions)) start end) (nreverse positions))) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 16 17:04:25 2015 Received: (at 20070) by debbugs.gnu.org; 16 Mar 2015 21:04:25 +0000 Received: from localhost ([127.0.0.1]:48993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXcBV-0002Tz-8n for submit@debbugs.gnu.org; Mon, 16 Mar 2015 17:04:25 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:45512 helo=homiemail-a21.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXcBS-0002Tk-SE for 20070@debbugs.gnu.org; Mon, 16 Mar 2015 17:04:23 -0400 Received: from homiemail-a21.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTP id 6F24630006C; Mon, 16 Mar 2015 14:04:22 -0700 (PDT) Received: from localhost.linkov.net (85.253.154.98.cable.starman.ee [85.253.154.98]) (Authenticated sender: jurta@jurta.org) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTPA id 5B574300064; Mon, 16 Mar 2015 14:04:21 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Organization: LINKOV.NET References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> Date: Mon, 16 Mar 2015 22:58:56 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 16 Mar 2015 09:19:12 -0400") Message-ID: <877fugr6yn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20070 Cc: =?iso-8859-1?Q?P=E5l_Gr=F8n=E5s?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> If the command used region-beginning and region-end, this means >> changing them to e.g. plural region-beginnings and region-ends. > > Here again, I'd rather use a list of pairs than a pair of lists, so we > wouldn't want to have 2 functions (one to get the list of beginnings > and another to get the list of ends). A list of pairs would be much cleaner, indeed. The problem is that there are 2 arguments already in region-handling commands: BEG and END. Using one of them for a list of pairs, and leaving another unused is not a nice thing to do. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 16 18:07:20 2015 Received: (at 20070) by debbugs.gnu.org; 16 Mar 2015 22:07:20 +0000 Received: from localhost ([127.0.0.1]:49012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXdAN-0003xa-Kf for submit@debbugs.gnu.org; Mon, 16 Mar 2015 18:07:19 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:13444) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXdAJ-0003xQ-I9 for 20070@debbugs.gnu.org; Mon, 16 Mar 2015 18:07:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AroTAPOG1lQXW5EB/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBVYjEAs0EhQYDSSIQM4jAQEBAQYBAQEBHo94B4QqAQSrNyKCMoFYIoEzBoE6AQEB X-IPAS-Result: AroTAPOG1lQXW5EB/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBVYjEAs0EhQYDSSIQM4jAQEBAQYBAQEBHo94B4QqAQSrNyKCMoFYIoEzBoE6AQEB X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113721581" Received: from 23-91-145-1.cpe.pppoe.ca (HELO pastel.home) ([23.91.145.1]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Mar 2015 18:07:14 -0400 Received: by pastel.home (Postfix, from userid 20848) id A341E2DDD; Mon, 16 Mar 2015 18:07:13 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Message-ID: References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <83h9tm0z8s.fsf@gnu.org> <87sid4r7av.fsf@mail.linkov.net> Date: Mon, 16 Mar 2015 18:07:13 -0400 In-Reply-To: <87sid4r7av.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 16 Mar 2015 22:55:36 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20070 Cc: paal.drange@gmail.com, Eli Zaretskii , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > - (setq s (point)) > + (setq s (point-marker)) Why return markers rather than integers? `region-beginning/region-end' return integers, not markers. The function receiving these positions can easily turn them into markers if it needs it. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 16 18:08:31 2015 Received: (at 20070) by debbugs.gnu.org; 16 Mar 2015 22:08:31 +0000 Received: from localhost ([127.0.0.1]:49016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXdBX-0003zN-Af for submit@debbugs.gnu.org; Mon, 16 Mar 2015 18:08:31 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:44176) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXdBW-0003zG-8F for 20070@debbugs.gnu.org; Mon, 16 Mar 2015 18:08:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lQXW5EB/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqBas3IoIygVgignMBAQE X-IPAS-Result: ArsTAPOG1lQXW5EB/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqBas3IoIygVgignMBAQE X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113721630" Received: from 23-91-145-1.cpe.pppoe.ca (HELO pastel.home) ([23.91.145.1]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Mar 2015 18:08:29 -0400 Received: by pastel.home (Postfix, from userid 20848) id C40D42DDD; Mon, 16 Mar 2015 18:08:28 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Message-ID: References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <877fugr6yn.fsf@mail.linkov.net> Date: Mon, 16 Mar 2015 18:08:28 -0400 In-Reply-To: <877fugr6yn.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 16 Mar 2015 22:58:56 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20070 Cc: =?windows-1252?B?UOVsIEdy+G7lcw==?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > A list of pairs would be much cleaner, indeed. The problem is that > there are 2 arguments already in region-handling commands: BEG and END. > Using one of them for a list of pairs, and leaving another unused > is not a nice thing to do. I think this "lack of niceness" is not strong enough to override the advantage of using a list of pairs. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 17 03:10:34 2015 Received: (at 20070) by debbugs.gnu.org; 17 Mar 2015 07:10:34 +0000 Received: from localhost ([127.0.0.1]:49111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXle6-0001jp-Ek for submit@debbugs.gnu.org; Tue, 17 Mar 2015 03:10:34 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:42173) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXle3-0001jg-Rr for 20070@debbugs.gnu.org; Tue, 17 Mar 2015 03:10:33 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NLC00E00H393D00@a-mtaout20.012.net.il> for 20070@debbugs.gnu.org; Tue, 17 Mar 2015 09:10:30 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLC00EQSH9H3I00@a-mtaout20.012.net.il>; Tue, 17 Mar 2015 09:10:30 +0200 (IST) Date: Tue, 17 Mar 2015 09:10:18 +0200 From: Eli Zaretskii Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region In-reply-to: <877fugr6yn.fsf@mail.linkov.net> X-012-Sender: halo1@inter.net.il To: Juri Linkov Message-id: <83fv94yu91.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <877fugr6yn.fsf@mail.linkov.net> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20070 Cc: paal.drange@gmail.com, 20070@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Juri Linkov > Date: Mon, 16 Mar 2015 22:58:56 +0200 > Cc: Pål Grønås Drange > , 20070@debbugs.gnu.org > > A list of pairs would be much cleaner, indeed. The problem is that > there are 2 arguments already in region-handling commands: BEG and END. > Using one of them for a list of pairs, and leaving another unused > is not a nice thing to do. Why not? AFAIK, we already have APIs where an argument could be either a buffer position or a string. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 17 15:40:33 2015 Received: (at 20070) by debbugs.gnu.org; 17 Mar 2015 19:40:33 +0000 Received: from localhost ([127.0.0.1]:50370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXxLt-00084Q-7y for submit@debbugs.gnu.org; Tue, 17 Mar 2015 15:40:33 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:57986 helo=homiemail-a11.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXxLr-00084I-Hv for 20070@debbugs.gnu.org; Tue, 17 Mar 2015 15:40:32 -0400 Received: from homiemail-a11.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTP id B7AE76E072; Tue, 17 Mar 2015 12:40:30 -0700 (PDT) Received: from localhost.linkov.net (82.131.98.6.cable.starman.ee [82.131.98.6]) (Authenticated sender: jurta@jurta.org) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPA id A07A96E071; Tue, 17 Mar 2015 12:40:29 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Organization: LINKOV.NET References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <877fugr6yn.fsf@mail.linkov.net> Date: Tue, 17 Mar 2015 21:38:06 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 16 Mar 2015 18:08:28 -0400") Message-ID: <87zj7b5s9t.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20070 Cc: =?iso-8859-1?Q?P=E5l_Gr=F8n=E5s?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> A list of pairs would be much cleaner, indeed. The problem is that >> there are 2 arguments already in region-handling commands: BEG and END. >> Using one of them for a list of pairs, and leaving another unused >> is not a nice thing to do. > > I think this "lack of niceness" is not strong enough to override the > advantage of using a list of pairs. I still have doubts about the API, but anyway here is the implementation that (ab)uses the first arg BEG: diff --git a/src/casefiddle.c b/src/casefiddle.c index 8755353..b77a0e6 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -306,14 +306,25 @@ return Qnil; } -DEFUN ("downcase-region", Fdowncase_region, Sdowncase_region, 2, 2, "r", +DEFUN ("downcase-region", Fdowncase_region, Sdowncase_region, 2, 2, + "(list (funcall region-extract-function 'positions) nil)", doc: /* Convert the region to lower case. In programs, wants two arguments. These arguments specify the starting and ending character numbers of the region to operate on. When used as a command, the text between point and the mark is operated on. */) (Lisp_Object beg, Lisp_Object end) { - casify_region (CASE_DOWN, beg, end); + if (CONSP (beg)) + { + while (CONSP (beg)) + { + casify_region (CASE_DOWN, XCAR (XCAR (beg)), XCDR (XCAR (beg))); + beg = XCDR (beg); + } + } + else + casify_region (CASE_DOWN, beg, end); + return Qnil; } From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 24 20:37:32 2015 Received: (at 20070) by debbugs.gnu.org; 25 Mar 2015 00:37:32 +0000 Received: from localhost ([127.0.0.1]:35397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YaZK8-00062r-7u for submit@debbugs.gnu.org; Tue, 24 Mar 2015 20:37:32 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:28477) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YaZK4-00062c-OX for 20070@debbugs.gnu.org; Tue, 24 Mar 2015 20:37:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAGvvdVTO+KpL/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDSSIE6IRjG0DAQKDPgMDg20Eo2OEWA X-IPAS-Result: AgUFAGvvdVTO+KpL/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDSSIE6IRjG0DAQKDPgMDg20Eo2OEWA X-IronPort-AV: E=Sophos;i="5.01,1,1400040000"; d="scan'208";a="114498878" Received: from 206-248-170-75.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([206.248.170.75]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Mar 2015 20:37:23 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id DA783AE122; Tue, 24 Mar 2015 20:37:22 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Message-ID: References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <877fugr6yn.fsf@mail.linkov.net> <87zj7b5s9t.fsf@mail.linkov.net> Date: Tue, 24 Mar 2015 20:37:22 -0400 In-Reply-To: <87zj7b5s9t.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 17 Mar 2015 21:38:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20070 Cc: =?windows-1252?B?UOVsIEdy+G7lcw==?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > I still have doubts about the API, but anyway here is the implementation > that (ab)uses the first arg BEG: That looks OK, thanks. I'm tempted to say that "r" should do (funcall region-extract-function 'positions), and fallback to passing the result as 2 separate positions if the result is a singleton list. Also, if we change "r" then I think it might make sense to pass a special value in the second arg to be more explicit then just nil (e.g. pass :split-region). Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 25 17:56:15 2015 Received: (at 20070) by debbugs.gnu.org; 25 Mar 2015 21:56:15 +0000 Received: from localhost ([127.0.0.1]:36673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YatHa-0002ZG-T7 for submit@debbugs.gnu.org; Wed, 25 Mar 2015 17:56:15 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:57597 helo=homiemail-a23.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YatHX-0002Z4-95 for 20070@debbugs.gnu.org; Wed, 25 Mar 2015 17:56:12 -0400 Received: from homiemail-a23.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTP id 436CA4B006F; Wed, 25 Mar 2015 14:56:10 -0700 (PDT) Received: from localhost.linkov.net (85.253.154.202.cable.starman.ee [85.253.154.202]) (Authenticated sender: jurta@jurta.org) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTPA id 3F74B4B0062; Wed, 25 Mar 2015 14:56:09 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Organization: LINKOV.NET References: <87bnjyf29d.fsf@mail.linkov.net> <87h9tmov9h.fsf@mail.linkov.net> <877fugr6yn.fsf@mail.linkov.net> <87zj7b5s9t.fsf@mail.linkov.net> Date: Wed, 25 Mar 2015 23:42:08 +0200 In-Reply-To: (Stefan Monnier's message of "Tue, 24 Mar 2015 20:37:22 -0400") Message-ID: <87iodoiwjz.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20070 Cc: =?iso-8859-1?Q?P=E5l_Gr=F8n=E5s?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > I'm tempted to say that "r" should do (funcall region-extract-function > 'positions), and fallback to passing the result as 2 separate positions > if the result is a singleton list. Then all unfixed commands will fail on the rectangular region, but they do the wrong thing now anyway, so this is not a problem. > Also, if we change "r" then I think > it might make sense to pass a special value in the second arg to be more > explicit then just nil (e.g. pass :split-region). Then the command signature could be changed from (downcase-region BEG END) to e.g. (downcase-region REGION REGION-TYPE) or maybe to signify their dual nature (downcase-region REGION-OR-BEG REGION-TYPE-OR-END) and I see no better way to do this. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 30 16:45:30 2015 Received: (at 20070) by debbugs.gnu.org; 30 Jun 2015 20:45:30 +0000 Received: from localhost ([127.0.0.1]:34811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZA2PJ-0002ch-AS for submit@debbugs.gnu.org; Tue, 30 Jun 2015 16:45:29 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:50145 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZA2PH-0002cM-EG; Tue, 30 Jun 2015 16:45:27 -0400 Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 835F37EC069; Tue, 30 Jun 2015 13:45:26 -0700 (PDT) Received: from localhost.linkov.net (m83-191-199-117.cust.tele2.ee [83.191.199.117]) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id 252707EC063; Tue, 30 Jun 2015 13:45:24 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Organization: LINKOV.NET References: Date: Tue, 30 Jun 2015 23:44:08 +0300 In-Reply-To: (Stefan Monnier's message of "Wed, 11 Mar 2015 16:28:03 -0400") Message-ID: <87bnfxsz8n.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20070 Cc: =?iso-8859-1?Q?P=E5l_Gr=F8n=E5s?= Drange , 20070@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) forcemerge 19829 20070 thanks > While this is not the same bug as bug#19829, it's fundamentally the same > issue, and they should be fixed in the same way. So I merged it with bug#19829 that provides a common patch. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 30 16:45:39 2015 Received: (at control) by debbugs.gnu.org; 30 Jun 2015 20:45:39 +0000 Received: from localhost ([127.0.0.1]:34818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZA2PS-0002dj-3w for submit@debbugs.gnu.org; Tue, 30 Jun 2015 16:45:38 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:37175 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZA2PN-0002d9-He; Tue, 30 Jun 2015 16:45:33 -0400 Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 7A25A25006C; Tue, 30 Jun 2015 13:45:30 -0700 (PDT) Received: from localhost.linkov.net (m83-191-199-117.cust.tele2.ee [83.191.199.117]) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPA id DB70D25006B; Tue, 30 Jun 2015 13:45:28 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#20626: Wishlist: M-x shell-command-on-rectangle-region Organization: LINKOV.NET References: <527474961.10107734.1432245870451.JavaMail.zimbra@comcast.net> <87twv51raf.fsf@mail.linkov.net> <87fv5s4pm0.fsf@mail.linkov.net> <874mlzweri.fsf@mail.linkov.net> <87k2uuc9mx.fsf@mail.linkov.net> <87twtv4byy.fsf@mail.linkov.net> Date: Tue, 30 Jun 2015 23:44:27 +0300 In-Reply-To: (Stefan Monnier's message of "Thu, 25 Jun 2015 21:53:42 -0400") Message-ID: <87a8vhsz83.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: 20626@debbugs.gnu.org, asparagus@comcast.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) forcemerge 19829 20626 thanks >> What is not clear is how to distinguish "slow&complex" from the "fast-= path"? >> Maybe with a new arg REGION? > > I thought it would be pretty easy: if region-extract-function returns > a single contiguous chunk or multiple chunks. =E2=80=98query-replace=E2=80=99 will use the same design, so merged it wi= th bug#19829 where I posted a composite patch. From unknown Mon Jun 23 00:33:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 12 Dec 2015 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator