Subject: Re: bug#55234: 28.1; replace-string in rectangle regio

From: Juri Linkov <[email-masked]>
Date: Wed, 01 Jun 2022 22:23:29 +0300

>> So the question is why `region-beginning` and `region-end`
>> don't return rectangular region boundaries.
>
> This is implemented with `rectangle--mark-crutches', right?  Note that
> these positions can be purely "virtual" (i.e., not exist in the buffer).

I thought that the implementation of region-beginning could be:

  (mapcar 'car (region-bounds))

or better for backward-compatibility:

  (caar (region-bounds))

and region-end:

  (cdar (last (region-bounds)))

Please try these on the original bug report - they completely fix the problem.

> BTW, my solution to the original problem: I implemented a command
> that lets me edit a rectangular region in a separate buffer (similar to
> `string-edit').

Isn't this a workaround?

PS: I'll reply to your other posts after more testing of search/replace problems.