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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 16 Feb 2025 07:42:43 +0200

> Cc: [email-masked]
> Date: Sat, 15 Feb 2025 17:18:15 -0500
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> We often need to replace a chunk of buffer text with something else.
> It is easy enough to do with `insert` + `delete-region`, but that
> has suboptimal behavior w.r.t markers, so rather than let coders
> reinvent a slightly-better replacement I propose we add a dedicated
> function for it.
> 
> So I suggest the patch below.  Comments?  Objections?

What's wrong with replace-buffer-contents or replace-region-contents?