aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love1998-08-25 13:28:44 +0000
committerDave Love1998-08-25 13:28:44 +0000
commit7d6a2ca41df02192d9321a712f271a1fbd087646 (patch)
treebbd1208058f8533a9c5559d98a6f9c3f55a42f05
parentddff3d800e7820d6d2d71f270afa90e5cc29ac71 (diff)
downloademacs-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.el14
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.
207With prefix arg, apply new prefix arg to that command; otherwise, maintain 210With prefix arg, apply new prefix arg to that command; otherwise, maintain
208prefix arg of most recently executed command if it had one. 211prefix arg of most recently executed command if it had one.
209This command is named after the `.' command in the vi editor. 212This command is like the `.' command in the vi editor.
210 213
211If this command is invoked by a multi-character key sequence, it can then 214If this command is invoked by a multi-character key sequence, it can then
212be repeated by repeating the final character of that sequence. This behavior 215be 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