[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83b
From: |
Adam Porter |
Subject: |
Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27 |
Date: |
Mon, 21 Nov 2022 15:19:43 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 |
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
- Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27,
Adam Porter <=