GNU bug report logs - #71370
30.0.50; Please un-obsolete buffer-substring as a generalized variable

Previous Next

Package: emacs;

Reported by: Adam Porter <adam <at> alphapapa.net>

Date: Wed, 5 Jun 2024 01:34:02 UTC

Severity: wishlist

Found in version 30.0.50

Full log


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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 71370 <at> debbugs.gnu.org, Ihor Radchenko <yantar92 <at> posteo.net>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, Adam Porter <adam <at> alphapapa.net>,
 Andrea Corallo <acorallo <at> gnu.org>, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#71370: 30.0.50; Please un-obsolete buffer-substring as a
 generalized variable
Date: Mon, 03 Mar 2025 09:32:57 +0100
Stefan Kangas <stefankangas <at> gmail.com> writes:

> 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.

This is a problem, yes (note we at least have `replace-region-contents'
in subr-x.el, though it's not exactly the same).

> FWIW, I don't see a huge need for a replacement function, and I think
> a generalized variable is perfectly serviceable in that case.

I don't, it's absolutely not, in my opinion.  This point had been
discussed somewhere above in this thread.  Short summary of my position:
the semantics of a generalized variable here is undefined, too unclear,
because there are already several, fundamentally different ways to
fulfill the contract "the place expression evals to the assigned value
after setting it": replacing text, inserting text and move what was
there after the inserted text, etc.  It is unclear what happens to
markers, overlays etc etc.  And all the difficulties that were hindering
Stefan to finish his version come on top - we just didn't discuss them
_here_.  `buffer-substring' was one of the worst generalized variables
that had been obsoleted.  The documentation doesn't tell anything about
how the setter behaves.  It's simply not existent.  Really bad,
actually, please don't get blinded by the lack of documentation and
discussion.

Let's better please wait for Stefan.  I'm sure that what he has is
already much much better than the simplistic setter we have.  I hope he
continues.  And if he doesn't, we still would have to go on with his
approach.


Michael.




This bug report was last modified 85 days ago.

Previous Next


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