[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#71370: 30.0.50; Please un-obsolete buffer-substring as a generalized
From: |
Eli Zaretskii |
Subject: |
bug#71370: 30.0.50; Please un-obsolete buffer-substring as a generalized variable |
Date: |
Wed, 05 Jun 2024 14:52:38 +0300 |
> Date: Tue, 4 Jun 2024 20:33:13 -0500
> From: Adam Porter <adam@alphapapa.net>
>
> Continuing with the theme of requesting the unobsoleting of some
> generalized variable forms (see [#65555] and [earlier discussion]), and
> given Eli's recently [mentioning] the upcoming cut of the Emacs 30
> release branch, I'd like to request now that `buffer-substring' be
> unmarked as obsolete.
I think it's too late to do this now, not without a very good reason.
Unless such a good reason emerges VSN, this will need to wait till
Emacs 31 at least.
> This form makes some operations much more concise than they would
> otherwise be. For example, if one wants to update the text in a
> `magit-section' section, the code could be as simple as this:
>
> ┌────
> │ (let ((inhibit-read-only t))
> │ (setf (buffer-substring (oref (magit-current-section) start)
> │ (oref (magit-current-section) end))
> │ "foobar\n"))
> └────
>
> Otherwise, one would have to use `delete-region' and then `insert',
> which is more cumbersome and error-prone.
I don't understand why it would be cumbersome, let alone error-prone.
Less convenient than using setf, yes, but "cumbersome"? We've been
doing that for decades.
Use of those specific forms as GV was obsoleted in 48aacbf29 because
they are rarely if ever used as GV. Unless this and the other two
requests suddenly get crowds of people demanding to un-obsolete them
(probably unlikely, since where were those people for the last 2
years?), I think Lars's decision to obsolete them is still solid.
IOW, this is just a matter of convenience, nothing more.
> As I've mentioned in earlier discussions, the mass-marking of several GV
> forms as obsolete in commit 48aacbf292fbe8d4be7761f83bf87de93497df27
> happened apparently without public discussion, as well as without
> checking the extent to which they are used outside of emacs.git.
We don't discuss obsoletion, because it is never final. The rationale
for obsoleting those forms is explained in the log message, so I think
the implied accusation here is misplaced.
> By the way, I'd also like to request that the `point' and `window-point'
> GV forms be unobsoleted, for the same reasons. If it's permissible, I'd
> like to do so here rather than file separate bug reports for each of
> those, but if the maintainers prefer, I will do so.
Let's see how many people want that now.