Winner Mode is part of GNU Emacs since version 20.
Winner Mode is a global minor mode. When activated, it allows to “undo” (and “redo”) changes in the window configuration with the key commands
‘C-c left’ and
‘C-c right’. In versions previous to Emacs 22, these keybindings used to be
‘C-x left’ and
Activate it with
‘M-x winner-mode RET’ or add the following to your ~/.emacs:
(when (fboundp 'winner-mode) (winner-mode 1))
‘fbound’ test is for those XEmacs installations that don’t have winner-mode available.
Winner Mode is great when you depend a lot on working with Emacs windows. To read code, you want one window. To compare it with another file, you want two windows, when on IRC you want six windows, while engaging in an important discussion, you want just one window, etc. Getting from many windows to one window is easy –
‘C-x 1’ will do it. But getting back to the delicate WindowConfiguration is difficult. This is where Winner Mode comes in: With it, going back to a previous session is easy.
winner-mode in the latest (2011-04-02 at least) breaks highlighting of spelling errors using flyspell-mode. Disabling winner-mode returns flyspell-mode functionality
Fixed as far as I can tell at least in 2011-04-08
In XEmacs similar functionality can be achieved with pop-window-configuration & unpop-window-configuration commands