summaryrefslogtreecommitdiff
path: root/lisp/kmacro.el
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2013-04-05 16:38:06 +0800
committerLeo Liu <sdl.web@gmail.com>2013-04-05 16:38:06 +0800
commitfc164b0c33ea4d65e5d1da2c3925569b032b398d (patch)
treeadc7f7e8e63540ffa23bea81a78b6c1005d7f1d2 /lisp/kmacro.el
parent0ccecc08cd5946f1dd3923d655862d160973f7dd (diff)
downloademacs-fc164b0c33ea4d65e5d1da2c3925569b032b398d.tar.gz
* kmacro.el (kmacro-call-macro): Fix bug#14135.
Diffstat (limited to 'lisp/kmacro.el')
-rw-r--r--lisp/kmacro.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index c08f49df0a7..d6de2feb3fc 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -631,11 +631,11 @@ others, use \\[kmacro-name-last-macro]."
(> (length (this-single-command-keys)) 1))
;; Used when we're in the process of repeating.
(eq no-repeat 'repeating))
- last-input-event))
- (last-kbd-macro (or macro last-kbd-macro)))
+ last-input-event)))
(if end-macro
- (kmacro-end-macro arg)
- (call-last-kbd-macro arg #'kmacro-loop-setup-function))
+ (kmacro-end-macro arg) ; modifies last-kbd-macro
+ (let ((last-kbd-macro (or macro last-kbd-macro)))
+ (call-last-kbd-macro arg #'kmacro-loop-setup-function)))
(when (consp arg)
(setq arg (car arg)))
(when (and (or (null arg) (> arg 0))
@@ -658,7 +658,9 @@ others, use \\[kmacro-name-last-macro]."
(define-key map (vector repeat-key)
`(lambda () (interactive)
(kmacro-call-macro ,(and kmacro-call-repeat-with-arg arg)
- 'repeating nil ,last-kbd-macro)))
+ 'repeating nil ,(if end-macro
+ last-kbd-macro
+ (or macro last-kbd-macro)))))
map)))))