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
> At the least, it would seem like a good idea to have an open discussion
> before removing 38 such setters from Elisp.
They were not removed: they were obsoleted.
When we mark a feature obsolete, it *is* a (last) call for discussion
before we remove it.
So go ahead, and argue away to defend those generalized vars you think
we should keep. Make those arguments concrete, tho: those 38 generalized
vars are pretty much all independent from each other, so each one should
be debated on its own merits.
Stefan
Hi Stefan, On 11/21/22 15:33, Stefan Monnier wrote: >> At the least, it would seem like a good idea to have an open discussion >> before removing 38 such setters from Elisp. > > They were not removed: they were obsoleted. > When we mark a feature obsolete, it *is* a (last) call for discussion > before we remove it. Ah, I misunderstood: I thought marking something as obsolete meant that the decision has been made, and users should begin removing it from their code. > So go ahead, and argue away to defend those generalized vars you think > we should keep. Make those arguments concrete, tho: those 38 generalized > vars are pretty much all independent from each other, so each one should > be debated on its own merits. I agree that each should be debated on its own merits. But has the burden been reversed? Could we argue why they should be removed rather than why they should be kept? I would generally argue that features that have been implemented should be considered useful (otherwise, why would they have been added?) and not be removed except for specific reasons. And I don't know who has the time to research and argue to undo 38 individual things that I wish hadn't been done all-at-once in the first place. :) Thanks, Adam
Adam Porter <adam@alphapapa.net> writes: > I agree that each should be debated on its own merits. But has the > burden been reversed? Could we argue why they should be removed rather > than why they should be kept? I would generally argue that features > that have been implemented should be considered useful (otherwise, why > would they have been added?) and not be removed except for specific > reasons. One reference is https://yhetil.org/emacs-devel/877d2w1ua0.fsf@tcd.ie -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
Adam Porter <adam@alphapapa.net> writes: > I agree that each should be debated on its own merits. But has the > burden been reversed? Could we argue why they should be removed rather > than why they should be kept? Lars did make the argument at the time that they had surprising and hard-to-understand semantics. So I think that general principle is one that we already try to follow. > And I don't know who has the time to research and argue to undo 38 > individual things that I wish hadn't been done all-at-once in the first > place. :) I'd suggest reporting bugs to unobsolete only the ones you care about. The ones you don't care about are probably okay to obsolete, right? And if they are not, others will report bugs.