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

From: Juri Linkov <[email-masked]>
Date: Wed, 24 Jun 2015 01:59:10 +0300

> I still believe that shell-command-on-region should not have
> rectangle-specific code.  The current `region-extract-function' does let
> you extract the region (rectangular or not) in order to pass it to
> a shell command.  So you don't need any rectangle-specific code for that
> part of shell-command-on-region.
> OTOH There is indeed some functionality missing there to let you insert
> the output in a rectangular way (whatever that means).

‘shell-command-on-region’ currently relies on the call to

   (call-process-region start end shell-file-name replace ...

but I'm not sure if ‘call-process-region’ is not too low level
to handle rectangular regions.  Otherwise, there should be a condition
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’.