diff options
| author | Juanma Barranquero | 2005-07-13 11:03:18 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2005-07-13 11:03:18 +0000 |
| commit | f7285f0fe95518e821bcb71d65d6d463a4a46233 (patch) | |
| tree | 3b0fb5838ddc7107d97bd74481df93e15602fa6d | |
| parent | 7f34d6d46241bc0061f5b3b2ac4ce7adcb6554f7 (diff) | |
| download | emacs-f7285f0fe95518e821bcb71d65d6d463a4a46233.tar.gz emacs-f7285f0fe95518e821bcb71d65d6d463a4a46233.zip | |
(winner-mode, winner-boring-buffers, winner-pending-undo-ring): Doc fixes.
(winner-ring): Remove unneeded `progn'.
(winner-equal): `defsubst' it.
(winner-redo): Fix message.
| -rw-r--r-- | lisp/winner.el | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lisp/winner.el b/lisp/winner.el index c64d00d6255..af72bea14d2 100644 --- a/lisp/winner.el +++ b/lisp/winner.el | |||
| @@ -78,7 +78,7 @@ | |||
| 78 | 78 | ||
| 79 | ;;;###autoload | 79 | ;;;###autoload |
| 80 | (defcustom winner-mode nil | 80 | (defcustom winner-mode nil |
| 81 | "Toggle winner-mode. | 81 | "Toggle Winner mode. |
| 82 | Setting this variable directly does not take effect; | 82 | Setting this variable directly does not take effect; |
| 83 | use either \\[customize] or the function `winner-mode'." | 83 | use either \\[customize] or the function `winner-mode'." |
| 84 | :set #'(lambda (symbol value) (funcall symbol (or value 0))) | 84 | :set #'(lambda (symbol value) (funcall symbol (or value 0))) |
| @@ -98,8 +98,7 @@ use either \\[customize] or the function `winner-mode'." | |||
| 98 | :group 'winner) | 98 | :group 'winner) |
| 99 | 99 | ||
| 100 | (defcustom winner-boring-buffers '("*Completions*") | 100 | (defcustom winner-boring-buffers '("*Completions*") |
| 101 | "`winner-undo' will not restore windows displaying any of these \ | 101 | "`winner-undo' will not restore windows displaying any of these buffers. |
| 102 | buffers. | ||
| 103 | You may want to include buffer names such as *Help*, *Apropos*, | 102 | You may want to include buffer names such as *Help*, *Apropos*, |
| 104 | *Buffer List*, *info* and *Compile-Log*." | 103 | *Buffer List*, *info* and *Compile-Log*." |
| 105 | :type '(repeat string) | 104 | :type '(repeat string) |
| @@ -108,7 +107,8 @@ You may want to include buffer names such as *Help*, *Apropos*, | |||
| 108 | 107 | ||
| 109 | 108 | ||
| 110 | 109 | ||
| 111 | ;;;; Saving old configurations (internal variables and subroutines) | 110 | |
| 111 | ;;;; Saving old configurations (internal variables and subroutines) | ||
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | ;;; Current configuration | 114 | ;;; Current configuration |
| @@ -162,13 +162,13 @@ You may want to include buffer names such as *Help*, *Apropos*, | |||
| 162 | ;; Find the right ring. If it does not exist, create one. | 162 | ;; Find the right ring. If it does not exist, create one. |
| 163 | (defsubst winner-ring (frame) | 163 | (defsubst winner-ring (frame) |
| 164 | (or (cdr (assq frame winner-ring-alist)) | 164 | (or (cdr (assq frame winner-ring-alist)) |
| 165 | (progn | 165 | (let ((ring (make-ring winner-ring-size))) |
| 166 | (let ((ring (make-ring winner-ring-size))) | 166 | (ring-insert ring (winner-configuration frame)) |
| 167 | (ring-insert ring (winner-configuration frame)) | 167 | (push (cons frame ring) winner-ring-alist) |
| 168 | (push (cons frame ring) winner-ring-alist) | 168 | ring))) |
| 169 | ring)))) | ||
| 170 | 169 | ||
| 171 | ;; If the same command is called several times in a row, | 170 | |
| 171 | ;; If the same command is called several times in a row, | ||
| 172 | ;; we only save one window configuration. | 172 | ;; we only save one window configuration. |
| 173 | (defvar winner-last-command nil) | 173 | (defvar winner-last-command nil) |
| 174 | 174 | ||
| @@ -176,7 +176,7 @@ You may want to include buffer names such as *Help*, *Apropos*, | |||
| 176 | (defvar winner-last-frames nil) | 176 | (defvar winner-last-frames nil) |
| 177 | 177 | ||
| 178 | 178 | ||
| 179 | (defun winner-equal (a b) | 179 | (defsubst winner-equal (a b) |
| 180 | "Check whether two Winner configurations (as produced by | 180 | "Check whether two Winner configurations (as produced by |
| 181 | `winner-conf') are equal." | 181 | `winner-conf') are equal." |
| 182 | (equal (cdr a) (cdr b))) | 182 | (equal (cdr a) (cdr b))) |
| @@ -240,7 +240,8 @@ You may want to include buffer names such as *Help*, *Apropos*, | |||
| 240 | 240 | ||
| 241 | 241 | ||
| 242 | 242 | ||
| 243 | ;;;; Restoring configurations | 243 | |
| 244 | ;;;; Restoring configurations | ||
| 244 | 245 | ||
| 245 | ;; Works almost as `set-window-configuration', | 246 | ;; Works almost as `set-window-configuration', |
| 246 | ;; but does not change the contents or the size of the minibuffer, | 247 | ;; but does not change the contents or the size of the minibuffer, |
| @@ -301,7 +302,8 @@ You may want to include buffer names such as *Help*, *Apropos*, | |||
| 301 | winner-point-alist) | 302 | winner-point-alist) |
| 302 | (point))))))) | 303 | (point))))))) |
| 303 | 304 | ||
| 304 | ;; Make sure point does not end up in the minibuffer and delete | 305 | |
| 306 | ;; Make sure point does not end up in the minibuffer and delete | ||
| 305 | ;; windows displaying dead or boring buffers | 307 | ;; windows displaying dead or boring buffers |
| 306 | ;; (c.f. `winner-boring-buffers'). Return nil iff all the windows | 308 | ;; (c.f. `winner-boring-buffers'). Return nil iff all the windows |
| 307 | ;; should be deleted. Preserve correct points and marks. | 309 | ;; should be deleted. Preserve correct points and marks. |
| @@ -410,7 +412,7 @@ With arg, turn Winner mode on if and only if arg is positive." | |||
| 410 | (defvar winner-undo-frame nil) | 412 | (defvar winner-undo-frame nil) |
| 411 | 413 | ||
| 412 | (defvar winner-pending-undo-ring nil | 414 | (defvar winner-pending-undo-ring nil |
| 413 | "The ring currently used by winner undo.") | 415 | "The ring currently used by `winner-undo'.") |
| 414 | (defvar winner-undo-counter nil) | 416 | (defvar winner-undo-counter nil) |
| 415 | (defvar winner-undone-data nil) ; There confs have been passed. | 417 | (defvar winner-undone-data nil) ; There confs have been passed. |
| 416 | 418 | ||
| @@ -437,7 +439,8 @@ In other words, \"undo\" changes in window configuration." | |||
| 437 | 439 | ||
| 438 | 440 | ||
| 439 | 441 | ||
| 440 | (defun winner-undo-this () ; The heart of winner undo. | 442 | |
| 443 | (defun winner-undo-this () ; The heart of winner undo. | ||
| 441 | (loop | 444 | (loop |
| 442 | (cond | 445 | (cond |
| 443 | ((>= winner-undo-counter (ring-length winner-pending-undo-ring)) | 446 | ((>= winner-undo-counter (ring-length winner-pending-undo-ring)) |
| @@ -467,7 +470,7 @@ In other words, \"undo\" changes in window configuration." | |||
| 467 | (ring-ref winner-pending-undo-ring 0))) | 470 | (ring-ref winner-pending-undo-ring 0))) |
| 468 | (unless (eq (selected-window) (minibuffer-window)) | 471 | (unless (eq (selected-window) (minibuffer-window)) |
| 469 | (message "Winner undid undo"))) | 472 | (message "Winner undid undo"))) |
| 470 | (t (error "Previous command was not a winner-undo")))) | 473 | (t (error "Previous command was not a `winner-undo'")))) |
| 471 | 474 | ||
| 472 | ;;; To be evaluated when the package is loaded: | 475 | ;;; To be evaluated when the package is loaded: |
| 473 | 476 | ||