diff options
| author | Dave Love | 1998-08-25 13:28:44 +0000 |
|---|---|---|
| committer | Dave Love | 1998-08-25 13:28:44 +0000 |
| commit | 7d6a2ca41df02192d9321a712f271a1fbd087646 (patch) | |
| tree | bbd1208058f8533a9c5559d98a6f9c3f55a42f05 | |
| parent | ddff3d800e7820d6d2d71f270afa90e5cc29ac71 (diff) | |
| download | emacs-7d6a2ca41df02192d9321a712f271a1fbd087646.tar.gz emacs-7d6a2ca41df02192d9321a712f271a1fbd087646.zip | |
(repeat): Doc fix.
[From rms:]
(repeat-previous-repeated-command): New variable.
(repeat): Check for real-last-command being null or repeat. Set
repeat-previous-repeated-command.
| -rw-r--r-- | lisp/repeat.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/repeat.el b/lisp/repeat.el index 4418043af4c..628ab90fafe 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el | |||
| @@ -201,12 +201,15 @@ this function is always whether the value of `this-command' would've been | |||
| 201 | 201 | ||
| 202 | ;;;;; ******************* THE REPEAT COMMAND ITSELF ******************* ;;;;; | 202 | ;;;;; ******************* THE REPEAT COMMAND ITSELF ******************* ;;;;; |
| 203 | 203 | ||
| 204 | (defvar repeat-previous-repeated-command nil | ||
| 205 | "The previous repeated command.") | ||
| 206 | |||
| 204 | ;;;###autoload | 207 | ;;;###autoload |
| 205 | (defun repeat (repeat-arg) | 208 | (defun repeat (repeat-arg) |
| 206 | "Repeat most recently executed command. | 209 | "Repeat most recently executed command. |
| 207 | With prefix arg, apply new prefix arg to that command; otherwise, maintain | 210 | With prefix arg, apply new prefix arg to that command; otherwise, maintain |
| 208 | prefix arg of most recently executed command if it had one. | 211 | prefix arg of most recently executed command if it had one. |
| 209 | This command is named after the `.' command in the vi editor. | 212 | This command is like the `.' command in the vi editor. |
| 210 | 213 | ||
| 211 | If this command is invoked by a multi-character key sequence, it can then | 214 | If this command is invoked by a multi-character key sequence, it can then |
| 212 | be repeated by repeating the final character of that sequence. This behavior | 215 | be repeated by repeating the final character of that sequence. This behavior |
| @@ -220,12 +223,17 @@ can be modified by the global variable `repeat-on-final-keystroke'." | |||
| 220 | ;; "repeat-" prefix, reserved by this package, for *local* variables that | 223 | ;; "repeat-" prefix, reserved by this package, for *local* variables that |
| 221 | ;; might be visible to re-executed commands, including this function's arg. | 224 | ;; might be visible to re-executed commands, including this function's arg. |
| 222 | (interactive "P") | 225 | (interactive "P") |
| 223 | (setq this-command real-last-command | 226 | (when (eq real-last-command 'repeat) |
| 224 | repeat-num-input-keys-at-repeat num-input-keys) | 227 | (setq real-last-command repeat-previous-repeated-command)) |
| 228 | (when (null real-last-command) | ||
| 229 | (error "There is nothing to repeat")) | ||
| 225 | (when (eq real-last-command 'mode-exit) | 230 | (when (eq real-last-command 'mode-exit) |
| 226 | (error "real-last-command is mode-exit & can't be repeated")) | 231 | (error "real-last-command is mode-exit & can't be repeated")) |
| 227 | (when (memq real-last-command repeat-too-dangerous) | 232 | (when (memq real-last-command repeat-too-dangerous) |
| 228 | (error "Command %S too dangerous to repeat automatically" real-last-command)) | 233 | (error "Command %S too dangerous to repeat automatically" real-last-command)) |
| 234 | (setq this-command real-last-command | ||
| 235 | repeat-num-input-keys-at-repeat num-input-keys) | ||
| 236 | (setq repeat-previous-repeated-command this-command) | ||
| 229 | (when (null repeat-arg) | 237 | (when (null repeat-arg) |
| 230 | (setq repeat-arg last-prefix-arg)) | 238 | (setq repeat-arg last-prefix-arg)) |
| 231 | ;; Now determine whether to loop on repeated taps of the final character | 239 | ;; Now determine whether to loop on repeated taps of the final character |