I’ve been using undo-tree for a long time but mostly I just take advantage of it’s (very much improved) redo functionality. The other day, I saw this tweet
Or just use M-x undo-tree-visualize to go to anywhere in any of your pasts #emacshttps://t.co/FudQrDBkVB
— Johan Lindstrom (@jplindstrom) September 23, 2016
which inspired me to try to learn a bit more about undo-tree
‘s features. The first thing, as suggested by the tweet is that you can step through the undo tree and your buffer will reflect the buffer state at that point in the undo tree. Once you get the buffer to the desired state, you can make that the current buffer or you can save that state to a register for later retrieval.
The main problem with undo-tree
is that it’s feature rich and a bit hard to figure out how things work. Fortunately, there’s a long commentary at the head of the source file that serves as a tutorial. If you read through that once or twice you’ll have a good idea of what it can do.
What undo-tree
really needs, I think, is a good video tutorial. Emacs Gifs has a short video on undo-tree-visualize but it doesn’t really show the power. I vaguely remember Magnar Sveen discussing it but I don’t think it was one of the Emacs Rocks videos. Mike Zamansky sometimes stops by Irreal; perhaps he’ll put it on his list of future Emacs videos. Sadly, I’m neither set up nor temperamentally suited to do the video so consider this a shameless attempt to get someone else to do the heavy lifting.
UPDATE
: Fixed link to Emacs Gifs.