From: Adam Porter <adam@alphapapa.net>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27
Date: Mon, 21 Nov 2022 15:19:43 -0600 [thread overview]
Message-ID: <ad42f4ad-d295-a3f3-577d-9bc91aee50d5@alphapapa.net> (raw)
Hi,
I recently received a bug report to one of my Elisp packages to replace
the use of a (setf (point) ...) form with (goto-char ...) because the
generalized setter has been marked as obsolete in Emacs 29. Digging
into emacs.git, I found that this was done in August in commit
48aacbf292fbe8d4be7761f83bf87de93497df27.
The rationale given by Lars was twofold:
- The vast majority of these are unused in-tree,
- many of them perform actions that aren't obvious when reading the
code.
The latter seems like a good reason to obsolete some forms. But the
former doesn't seem like a good reason to remove working code. AFAIK, a
simple (setf (point) ...) form, for example, doesn't cause any problems
or have any unexpected side effects.
I discovered the ability to use forms like (point) as generalized
variables relatively recently, and I've enjoyed using it in my code, as
it follows a convenient, more concise pattern in many cases. I'd
generally (ha) like to see more generalized variables and setters in
Elisp, not less. The fact that many such forms have gone unused for a
while in-tree is likely due to few people being aware that they can be
used, as well as the existence of (setf ...) itself being relatively
unknown among Elispers. I don't think it means that no one wants to use
them, or that no one would do so in the future.
So I'd like to ask that this commit, or at least some parts of it, be
reverted--that the setters that present no traps for the unwary
programmer be restored to fully accepted status.
At the least, it would seem like a good idea to have an open discussion
before removing 38 such setters from Elisp. If these kinds of setters
are to be disallowed, it seems like that ought to be a known policy with
a stated justification rather than an unwritten rule.
(Please cc me on replies.)
Thanks,
Adam
next reply other threads:[~2022-11-21 21:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 21:19 Adam Porter [this message]
2022-11-21 21:33 ` Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27 Stefan Monnier
2022-11-21 22:11 ` Adam Porter
2022-11-22 0:02 ` Ihor Radchenko
2022-11-22 1:56 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad42f4ad-d295-a3f3-577d-9bc91aee50d5@alphapapa.net \
--to=adam@alphapapa.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).