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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 76313 <at> debbugs.gnu.org
Subject: bug#76313: New function `replace-region`
Date: Tue, 18 Feb 2025 21:30:33 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: 76313 <at> debbugs.gnu.org
> Date: Tue, 18 Feb 2025 12:01:38 -0500
> 
> >> `replace-region-contents` is a bad API
> > Why is it bad?
> 
> - REPLACE-FN is never useful, it's always just as easy (and marginally
>   more efficient) to compute the replacement beforehand.
> - It defaults to being expensive, whereas most potential users of
>   `replace-region` currently use insert+delete-region and thus would
>   need to pass an extra "cheaply" argument for fear of being impacted by
>   a slowdown.
> - MAX-COSTS is ill-defined.
> 
> Also, personally I must say that I'd be happier calling `replace-region`
> than `replace-region-contents`, just because it's shorter.
> 
> Given that `replace-region-contents` is fairly new and very little used,
> I don't see much gain in trying to fit within its API.

So basically, you reject every attempt to compromise that I could come
up with, and keep pressing for your original proposal, whose downsides
I prefer not to sustain.  Are you really saying that your way is the
only way? why?




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.