GNU bug report logs - #76313
New function `replace-region`

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sat, 15 Feb 2025 22:19:02 UTC

Severity: normal

Tags: patch

Full log


Message #29 received at 76313 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 76313 <at> debbugs.gnu.org
Subject: Re: bug#76313: New function `replace-region`
Date: Mon, 17 Feb 2025 18:14:41 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: 76313 <at> debbugs.gnu.org
> 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.




This bug report was last modified 75 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.