summaryrefslogtreecommitdiff
path: root/lisp/repeat.el
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>1998-08-25 13:28:44 +0000
committerDave Love <fx@gnu.org>1998-08-25 13:28:44 +0000
commit7d6a2ca41df02192d9321a712f271a1fbd087646 (patch)
treebbd1208058f8533a9c5559d98a6f9c3f55a42f05 /lisp/repeat.el
parentddff3d800e7820d6d2d71f270afa90e5cc29ac71 (diff)
downloademacs-7d6a2ca41df02192d9321a712f271a1fbd087646.tar.gz
(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.
Diffstat (limited to 'lisp/repeat.el')
-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
;;;;; ******************* THE REPEAT COMMAND ITSELF ******************* ;;;;;
+(defvar repeat-previous-repeated-command nil
+ "The previous repeated command.")
+
;;;###autoload
(defun repeat (repeat-arg)
"Repeat most recently executed command.
With prefix arg, apply new prefix arg to that command; otherwise, maintain
prefix arg of most recently executed command if it had one.
-This command is named after the `.' command in the vi editor.
+This command is like the `.' command in the vi editor.
If this command is invoked by a multi-character key sequence, it can then
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'."
;; "repeat-" prefix, reserved by this package, for *local* variables that
;; might be visible to re-executed commands, including this function's arg.
(interactive "P")
- (setq this-command real-last-command
- repeat-num-input-keys-at-repeat num-input-keys)
+ (when (eq real-last-command 'repeat)
+ (setq real-last-command repeat-previous-repeated-command))
+ (when (null real-last-command)
+ (error "There is nothing to repeat"))
(when (eq real-last-command 'mode-exit)
(error "real-last-command is mode-exit & can't be repeated"))
(when (memq real-last-command repeat-too-dangerous)
(error "Command %S too dangerous to repeat automatically" real-last-command))
+ (setq this-command real-last-command
+ repeat-num-input-keys-at-repeat num-input-keys)
+ (setq repeat-previous-repeated-command this-command)
(when (null repeat-arg)
(setq repeat-arg last-prefix-arg))
;; Now determine whether to loop on repeated taps of the final character