bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25860: 25.1; Double macro execution


From: Tino Calancha
Subject: bug#25860: 25.1; Double macro execution
Date: Sat, 25 Feb 2017 14:41:36 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Andreas Schwab <address@hidden> writes:

> On Feb 24 2017, Marek Twardochlib <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]