Subject: bug#20626: Wishlist: M-x shell-command-on-rectangle-region

From: Juri Linkov <[email-masked]>
Date: Thu, 25 Jun 2015 01:27:18 +0300

>> in ‘shell-command-on-region’ to check for a rectangular region and
>> insert the output accordingly, so I see no way to avoid checking for
>> ‘rectangle-mark-mode’ in ‘shell-command-on-region’.
>
> In any case checking specifically for a rectangular region is wrong.
> Having a "fast-path" for the case of a simple contiguous region is fine,
> but the "slow&complex" path is not just for rectangular regions:
> the code should also work with a region made up of various
> arbitrary chunks (there's currently no package that provides this
> feature, but that's no excuse).

Then what about adding a new arg REGION to ‘shell-command-on-region’
and other region-sensitive commands that will provide the region
configuration including information about region type and region shape,
e.g. a list in the form ‘(rectangle …)’.  Then the command's body
will check the car of the arg REGION and act accordingly depending
on the region shape.