all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#71370: 30.0.50; Please un-obsolete buffer-substring as a generalized variable
@ 2024-06-05  1:33 Adam Porter
  2024-06-05 11:52 ` Eli Zaretskii
  2024-06-19 23:44 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 18+ messages in thread
From: Adam Porter @ 2024-06-05  1:33 UTC (permalink / raw)
  To: 71370

Hi,

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.

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.

As well, code exists in the wild which uses this form: for example,
[pcre2el], a very useful library which I use in `magit-todos' to convert
regexp between Elisp and Perl-styles.

Overall, it's a useful paradigm that makes code more readable and
concise, and I'm not aware of any drawbacks to using it; if there are
any, I think they should be discussed publicly before marking the form
as obsolete.

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.

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.

Thanks for your consideration, and your work on Emacs.

–Adam


[#65555] <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65555>

[earlier discussion]
<https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01408.html>

[mentioning]
<https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00042.html>

[pcre2el]
<https://github.com/joddie/pcre2el/blob/380723b2701cceb75c266440fb8db918f3340d50/pcre2el.el#L663>





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-06-27 15:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05  1:33 bug#71370: 30.0.50; Please un-obsolete buffer-substring as a generalized variable Adam Porter
2024-06-05 11:52 ` Eli Zaretskii
2024-06-05 12:09   ` Ihor Radchenko
2024-06-05 14:16   ` Adam Porter
2024-06-05 14:58     ` Eli Zaretskii
2024-06-05 17:35       ` Adam Porter
2024-06-19 23:44 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-20  4:05   ` Adam Porter
2024-06-20 15:33     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-20 15:46       ` Ihor Radchenko
2024-06-21  8:55         ` Andrea Corallo
2024-06-21 22:52           ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-22  6:05             ` Ihor Radchenko
2024-06-22  8:16               ` Eli Zaretskii
2024-06-22  8:39                 ` Ihor Radchenko
2024-06-22  9:45                   ` Eli Zaretskii
2024-06-22  7:13             ` Eli Zaretskii
2024-06-27 15:09   ` Adam Porter

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.