- (if (or (stringp real-last-command)
- (vectorp real-last-command))
- (execute-kbd-macro real-last-command)
- (call-interactively real-last-command))))
+ (let ((indirect (indirect-function real-last-command)))
+ (if (or (stringp indirect)
+ (vectorp indirect))
+ ;; Bind real-last-command so that executing the macro
+ ;; does not alter it.
+ (let ((real-last-command real-last-command))
+ (execute-kbd-macro real-last-command))
+ (call-interactively real-last-command)))))