3 ms·
> No, there is no undo "tree", nor any complicated graphical user interface to go with. ... You've got your undos, your redos, and that's it. The underlying dat
by ctrlmeta 4y ago
> No, there is no undo "tree", nor any complicated graphical user interface to go with. ... You've got your undos, your redos, and that's it. The underlying data structure is strictly linear, but all edit states are preserved and reachable ...
This is exactly how Emacs works!
Emacs has worked like this since its beginning in 1980s. It was even documented in the first manual (1981):
This might seem to pile one disaster on another, but it doesn't, because vou can always Undo the Undo if it didn’t help. (page 137 of manual)
I think there needs to be some sort of computing and software history lessons. It can offer great value in the current world of software development. It will save you from the trouble of rediscovering techniques that are already in use in classic battle-tested software.
(And really? You need to invent a cheesy acronym for this? If that's what it takes to sell the obvious these days, how about SLUR - Simple Linear Undo Redo?)
- vitiral 4y agoOf course emacs implements it as just a long linked list.
- coldacid 4y agoIt doesn't need to be anything else.
- nerdponx 4y agoVim also has an undo tree, although you need a plugin to work with it easily (called "Undotree").
- zwkrt 4y agoYes but the article is specially calling out that using an undo tree is something no one wants.
- lostcolony 4y agoAnd that you still want a linear path through your undos and redos...and that's something that Emacs does.
- cwillu 4y agoIt's more of an implementation detail that is available to users. The article's simplification is also available via :earlier and :later, with the added bonus that they can take _time_ as a parameter as well as a simple revision count. “:earlier 1h” has been handy more than once.
- mananaysiempre 4y agoKakoune, like the more logical Vim it is, has both in a sensible arrangement: an undo tree with a current branch, which you can navigate up and down (u/U), and a linear history of the path you took through that tree, which you can navigate backwards and forwards (<a-u>/<a-U>). Unlike a single undo branch, you’re never afraid you’re going to lose your work when you need to go rescue a piece from a previous version; unlike a plain linear history like TFA proposes and Emacs uses, you’re not punished with a quadratic number of undo/redo pairs if you need a point behind several parallel do-overs of the same part. Unfortunately, without any sort of visible representation of all that I frequently find myself getting lost in the whole thing. (Now that I’m thinking about it, Git’s commit tree and reflog play a similar pair of complementary roles locally.)
- kleiba 4y ago> This is exactly how Emacs works! ...and has been since forever. Thus I don't understand what the fuss is?!
- deleted 4y ago[deleted]
- coldacid 4y agoI blame CADT.
- db48x 4y agoIn Anathem there were academics who spent their entire lives learning the history of academic scholarship for the express purpose of reminding everyone how often things are reinvented and preventing people from getting too excited when they have discovered something that was already known. I’m drawing a blank on their name, but it was one of the things about the book that I really enjoyed. It really helped to sell the setting, where the scientific method has been known and used continuously for 5,000 years or more.