bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20070: 24.3; have commands such as downcase-region act on a rectangl


From: Juri Linkov
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu)

> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]