Subject: Re: bug#25860: 25.1; Double macro execution

From: Tino Calancha <[email-masked]>
Date: Sat, 25 Feb 2017 14:41:36 +0900

Andreas Schwab <[email-masked]> writes:

> On Feb 24 2017, Marek Twardochlib <[email-masked]> wrote:
>
>> Then I define another macro that simply call the previous macro
>> insert-a.
>
> How did you do that?
DUNNO how to solve the problem, but i guess th OP means the following:

(defun insert-a-fn (&optional arg)
  (interactive "p")
  (insert "a\n"))

F3 a RET F4
C-x C-k n insert-a RET

(symbol-function 'insert-a)
=>
(lambda (&optional arg)
  "Keyboard macro."
  (interactive "p")
  (kmacro-exec-ring-item (quote ([97 return] 0 "%d")) arg))

I) ;;; Using `insert-a-fn' we insert "a" _once_:
F3 M-x insert-a-fn RET F4
;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to cancel.
;; Original keys: <<insert-a-fn>>

Command: last-kbd-macro
Key: none

Macro:

<<insert-a-fn>>		;; insert-a-fn

II) ;;; Using macro `insert-a' we insert "a" _twice_; so you need to remove
    ;;; <<insert-a>> line by hand:
F3 M-x insert-a RET F4
C-x C-k e RET
;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to cancel.
;; Original keys: <<insert-a>> a RET

Command: last-kbd-macro
Key: none

Macro:

<<insert-a>>		;; insert-a
a			;; self-insert-command
RET			;; newline