There are a few packages for redo. Of the ones i've used are:
The redo.el works ok, but occasionally it corrupts your undo… meaning that you know there's more undo/redo but wasn't able to get to it. This happens perhaps once a month.
The redo+.el is supposed to update/modernize the code. Unfortunately, i didn't have luck with it. These Kyle based redo modes are ≈200 lines of elisp, each.
The undo-tree.el i just installed today, and it seems the best of the bunch. It includes a redo command “undo-tree-redo”. Plus, it gives you commands to visualize the full emacs undo tree. This package is about 2k lines of code, not counting comments.
If you have emacs 24, you can install undo-tree-mode from the MELPA repository. 〔☛ A Guide on Emacs Package System〕
Or, download “undo-tree-mode” at Source www.dr-qubit.org
then, place it at 〔~/.emacs.d/undo-tree.el〕.
then, place the following in your emacs init file:
(require 'undo-tree) (global-undo-tree-mode 1)
By default, the keys to undo are {【Ctrl+/】, 【Ctrl+_】}. The keys to redo are: {【Ctrl+?】, 【Meta+_】}
〔undo-tree-mode.el〕 is written by Toby Cubitt http://www.dr-qubit.org/emacs.php . Thanks Toby.
You can set them to the Z key:
(defalias 'redo 'undo-tree-redo) (global-set-key (kbd "C-z") 'undo) ; 【Ctrl+z】 (global-set-key (kbd "C-S-z") 'redo) ; 【Ctrl+Shift+z】; Mac style (global-set-key (kbd "C-y") 'redo) ; 【Ctrl+y】; Microsoft Windows style
Thanks to David Capello for suggesting undo-tree-mode.