This article says that "Emacs has redo because you can reverse direction while undoing, thereby undoing the undo".
What does this mean? How can a user 'redo' with Emacs?
in plain emacs, to redo, just press Ctrl + g first then undo. Further undo will be redo. Press Ctrl + g again to reverse direction.
Therefore, to re-apply changes you have undone, type 'C-f' or any other command that harmlessly breaks the sequence of undoing; then type 'C-/' to undo the undo command. On the other hand, if you want to resume undoing, without redoing previous undo commands, use 'M-x undo-only' .
Redo actions that you undidPress CTRL+Y repeatedly until the actions are redone. On the Quick Access Toolbar, click the arrow next to Redo , and then click the actions that you want to redo. The actions are redone in the order in which they are listed. You can only redo the actions in the order in which they occurred.
Emacs records a list of changes made in the buffer text, so you can undo recent changes. This is done using the undo command, which is bound to C-/ (as well as C-x u and C-_ ). Normally, this command undoes the last change, moving point back to where it was before the change.
Short version: by undoing the undo. If you undo, and then do a non-editing command such as C-f, then the next undo will undo the undo, resulting in a redo.
Longer version:
You can think of undo as operating on a stack of operations. If you perform some command (even a navigation command such as C-f) after a sequence of undo operations, all the undos are pushed on to the operation stack. So the next undo undoes the last command. Suppose you do have an operation sequence that looks like this:
Now, you undo. It undoes the last action, resulting in the following list:
If you do something other than undo at this point - say, C-f, the operation stack looks like this:
Now, when you undo, the first thing that is undone is the undo. Resulting in your original stack (and document state):
If you do a modifying command to break the undo sequence, that command is added after the undo and is thus the first thing to be undone afterwards. Suppose you backspaced over "bar" instead of hitting C-f. Then you would have had
This adding/re-adding happens ad infinitum. It takes a little getting used to, but it really does give Emacs a highly flexible and powerful undo/redo mechanism.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With