GNU bug report logs - #20070
24.3; have commands such as downcase-region act on a rectangle region

Previous Next

Package: emacs;

Reported by: Pål Grønås Drange <paal.drange <at> gmail.com>

Date: Tue, 10 Mar 2015 02:20:02 UTC

Severity: normal

Merged with 19829, 20626

Found in versions 24.3, 25.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 20070 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Pål Grønås Drange <paal.drange <at> gmail.com>,
 20070 <at> debbugs.gnu.org
Subject: Re: bug#20070: 24.3;
 have commands such as downcase-region act on a rectangle region
Date: Sun, 15 Mar 2015 22:34:02 +0200
> 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.




This bug report was last modified 9 years and 195 days ago.

Previous Next


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