Subject: Re: bug#71370: 30.0.50; Please un-obsolete buffer-substring as a generalized variable

From: Stefan Kangas <[email-masked]>
Date: Sun, 23 Mar 2025 12:48:26 +0000

Stefan Kangas <[email-masked]> writes:

> Michael Heerdegen <[email-masked]> writes:
>
>> Stefan Kangas <[email-masked]> writes:
>>
>>> If not, I think what Sean writes above is the way to go.
>>
>> What about what I said and Sean agreed to?  Did you read my replies?
>
> Yes, if you mean this part:
>
>         Please let's keep those two separate questions separate: (1) is a
>         certain functionality useful, and (2) if it is, should it be provided,
>         maybe even only, as a gv setter function.
>
> As for `buffer-substring`, if we can't have a function that provides
> that functionality (the proposed `replace-region`), then (setf
> (buffer-substring ...) ...) is clearly _not_ obsolete and shouldn't be
> marked as such.
>
> As for `buffer-string`, I don't know any proposed replacement function,
> so I think it's not obsolete on these grounds too.  FWIW, I don't see a
> huge need for a replacement function, and I think a generalized variable
> is perfectly serviceable in that case.

It seems like we can't find agreement on a way forward for adding
`replace-region` in Bug#76313, or even on which functions to obsolete
or how.

I therefore see no better alternative than unobsoleting the generalized
variable `buffer-substring`, and `buffer-string` too for similar
reasons.  I would also invite patches to update the documentation of
both functions to mention this, but I don't consider that a blocker for
their unobsoletion (i.e., it's no worse than what we had before Emacs
29.1).

I don't see any blocker for unobsoleting them already in Emacs 30.2.