X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/95a2cb24b0697558e6629460d8bc693b394f0138..3698c4e475fb59730626af5d001599785ef5ef9e:/lisp/winner.el diff --git a/lisp/winner.el b/lisp/winner.el index f244003b06..9a6f5d5190 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -1,6 +1,6 @@ ;;; winner.el --- Restore old window configurations -;; Copyright (C) 1997-1998, 2001-2015 Free Software Foundation, Inc. +;; Copyright (C) 1997-1998, 2001-2016 Free Software Foundation, Inc. ;; Author: Ivar Rummelhoff ;; Created: 27 Feb 1997 @@ -177,6 +177,12 @@ You may want to include buffer names such as *Help*, *Apropos*, ;; Called whenever the window configuration changes ;; (a `window-configuration-change-hook'). (defun winner-change-fun () + + ;; Cull dead frames. + (setq winner-modified-list + (cl-loop for frame in winner-modified-list + if (frame-live-p frame) collect frame)) + (unless (or (memq (selected-frame) winner-modified-list) (/= 0 (minibuffer-depth))) (push (selected-frame) winner-modified-list))) @@ -340,7 +346,19 @@ You may want to include buffer names such as *Help*, *Apropos*, ;;;###autoload -(define-minor-mode winner-mode nil :global t ; let d-m-m make the doc +(define-minor-mode winner-mode + "Toggle Winner mode on or off. +With a prefix argument ARG, enable Winner mode if ARG is +positive, and disable it otherwise. If called from Lisp, enable +the mode if ARG is omitted or nil, and toggle it if ARG is ‘toggle’. + +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 '. If you change your mind (while undoing), +you can press `C-c ' (calling `winner-redo')." + :global t (if winner-mode (progn (add-hook 'window-configuration-change-hook 'winner-change-fun) @@ -415,7 +433,7 @@ In other words, \"undo\" changes in window configuration." (ring-ref winner-pending-undo-ring 0))) (unless (eq (selected-window) (minibuffer-window)) (message "Winner undid undo"))) - (t (error "Previous command was not a `winner-undo'")))) + (t (user-error "Previous command was not a `winner-undo'")))) (provide 'winner) ;;; winner.el ends here