Mercurial > emacs
comparison lisp/winner.el @ 20086:92b4edaf6482
(winner-pending-undo-ring): Defvar before first use.
(winner-undo-counter): Likewise.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 16 Oct 1997 23:25:57 +0000 |
parents | 735f0cdfc5b9 |
children | 7072722c5071 |
comparison
equal
deleted
inserted
replaced
20085:05408326bad6 | 20086:92b4edaf6482 |
---|---|
127 (setq winner-mode nil) | 127 (setq winner-mode nil) |
128 (run-hooks 'winner-mode-leave-hook))) | 128 (run-hooks 'winner-mode-leave-hook))) |
129 (force-mode-line-update))) | 129 (force-mode-line-update))) |
130 | 130 |
131 ;; Inspired by undo (simple.el) | 131 ;; Inspired by undo (simple.el) |
132 | |
133 (defvar winner-pending-undo-ring nil) | |
134 | |
135 (defvar winner-undo-counter nil) | |
136 | |
132 (defun winner-undo (arg) | 137 (defun winner-undo (arg) |
133 "Switch back to an earlier window configuration saved by Winner mode. | 138 "Switch back to an earlier window configuration saved by Winner mode. |
134 In other words, \"undo\" changes in window configuration." | 139 In other words, \"undo\" changes in window configuration." |
135 (interactive "p") | 140 (interactive "p") |
136 (cond | 141 (cond |
144 (setq winner-pending-undo-ring (winner-ring (selected-frame))) | 149 (setq winner-pending-undo-ring (winner-ring (selected-frame))) |
145 (setq winner-undo-counter 0)) | 150 (setq winner-undo-counter 0)) |
146 (winner-undo-more (or arg 1)) | 151 (winner-undo-more (or arg 1)) |
147 (message "Winner undo (%d)!" winner-undo-counter) | 152 (message "Winner undo (%d)!" winner-undo-counter) |
148 (setq this-command 'winner-undo)))) | 153 (setq this-command 'winner-undo)))) |
149 | |
150 (defvar winner-pending-undo-ring nil) | |
151 | |
152 (defvar winner-undo-counter nil) | |
153 | 154 |
154 (defun winner-undo-more (count) | 155 (defun winner-undo-more (count) |
155 "Undo N window configuration changes beyond what was already undone. | 156 "Undo N window configuration changes beyond what was already undone. |
156 Call `winner-undo-start' to get ready to undo recent changes, | 157 Call `winner-undo-start' to get ready to undo recent changes, |
157 then call `winner-undo-more' one or more times to undo them." | 158 then call `winner-undo-more' one or more times to undo them." |