GNU bug report logs -
#76313
New function `replace-region`
Previous Next
Full log
Message #47 received at 76313 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: 76313 <at> debbugs.gnu.org
> Date: Tue, 18 Feb 2025 08:30:16 -0500
>
> > (replace-buffer-contents SOURCE &optional MAX-SECS MAX-COSTS CHEAP-AND-RECKLESS)
>
> Hmm... I don't think people will be happy to replace their
>
> (insert foo)
> (delete-region from to)
>
> with
>
> (save-restriction
> (narrow-to-region from to)
> (replace-buffer-contents foo nil nil 'cheap))
>
> Without mentioning that it would be a backward-incompatible change because
> currently `replace-buffer-contents` considers a string argument as the
> name of a buffer.
Then how about reimplementing replace-region-contents in C, and making
a similar change (an additional optional arg) to it instead?
> `replace-region-contents` is a bad API
Why is it bad?
This bug report was last modified 77 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.