News for hackers. Stuff that matters.
Re:Ask HN: Why can't you undo changes after quitting and rel... by spindle on Thursday April 21, 2022 @06:32PM (#31115991)
In most OSes, this would require a tricky decision about where to save the undo data. If you save it in each document (assuming a typical document model), you've got bloat of the documents, and if you save it elsewhere, you've got potential privacy and confidentiality issues (and also still maybe bloat).

There are packages for Emacs that persist undo data. I use one, and love it. I think the above reason is probably the reason they're not included in the base distribution.

Re:Ask HN: Why can't you undo changes after quitting and rel... by amichail on Thursday April 21, 2022 @06:34PM (#31116012)
Why can't you save it in an ".undo" file alongside the main file? Why would there be a privacy issue?
Re:Ask HN: Why can't you undo changes after quitting and rel... by spindle on Thursday April 21, 2022 @06:47PM (#31116121)
Good point! Some people would see that as a bloat issue, maybe? Things like that occasionally cause complaints for emacs. Personally I think it's a great idea.

I expect you've already considered this, but undo data can be huge. Often I paste something big into a file and then immediately (for whatever reason) delete it, and the big thing is then in my undo data forever if I persist it. Of course, there could be settings to allow user control over this, just like with the Trash in MacOS.