Subject: bug#76313: New function `replace-region`

From: Eli Zaretskii <[email-masked]>
Date: Mon, 17 Feb 2025 18:14:41 +0200

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked]
> Date: Mon, 17 Feb 2025 10:03:26 -0500
> 
> >> >> I'm not sure it'd be a good idea, tho: `replace-region-contents` is
> >> >> a "heavy" operation, involving narrowing and another buffer, whereas
> >> >> `replace-region` is meant to be a low-level operation (if we implement
> >> >> it in C, we could arguably use it as *the* low-level operation and
> >> >> define `insert` and `delete-region` on top of it).
> >> >
> >> > On the downside, we already have 2 APIs for this, so having a 3rd one
> >> > will only make the confusion more prominent.
> >> 
> >> We could start by merging `replace-region-contents` and
> >> `replace-buffer-contents`.
> >
> > Fine by me, thanks.
> 
> So does that mean you're OK with my new `replace-region`, and that
> I should open a new bug-report with a proposal for how to merge
> `replace-region-contents` and `replace-buffer-contents`?
> 
> Or something else?

You suggested to merge replace-region-contents with
replace-buffer-contents when replace-region was not on the table at
all.  I'm still not sure we want a 3rd API for this purpose.