Variable: winner-mode

winner-mode is a customizable variable defined in winner.el.gz.

Value

nil

Documentation

Non-nil if Winner mode is enabled.

See the winner-mode(var)/winner-mode(fun) command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node (emacs)Easy Customization) or call the function winner-mode(var)/winner-mode(fun).

View in manual

Probably introduced at or before Emacs version 20.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/winner.el.gz
;;;###autoload
(define-minor-mode winner-mode
  "Toggle Winner mode on or off.

Winner mode is a global minor mode that records the changes in
the window configuration (i.e. how the frames are partitioned
into windows) so that the changes can be \"undone\" using the
command `winner-undo'.  By default this one is bound to the key
sequence \\`C-c <left>'.  If you change your mind (while undoing),
you can press \\`C-c <right>' (calling `winner-redo').

If you use `tab-bar-mode', consider using `tab-bar-history-mode', as
`winner-mode' is unaware of tab switching, and might turn the window
configuration of the current tab to another's (old) window
configuration.  `tab-bar-history-mode' provides tab-specific window
configuration history avoiding this problem."
  :global t
  (if winner-mode
      (progn
        (add-hook 'window-configuration-change-hook 'winner-change-fun)
        (add-hook 'post-command-hook 'winner-save-old-configurations)
        (add-hook 'minibuffer-setup-hook 'winner-save-unconditionally)
        (setq winner-modified-list (frame-list))
        (winner-save-old-configurations))
    (remove-hook 'window-configuration-change-hook 'winner-change-fun)
    (remove-hook 'post-command-hook 'winner-save-old-configurations)
    (remove-hook 'minibuffer-setup-hook 'winner-save-unconditionally)))