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

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

Re: How to get keyboard macro that was just run?


From: Okamsn
Subject: Re: How to get keyboard macro that was just run?
Date: Sun, 18 Jun 2023 17:05:38 +0000

On 2023-06-18 15:53 UTC, Eduardo Ochs wrote:
> Hi Okamsn,
> try to run this with C-x C-e:
> 
> (insert (format "\n\%S\n"
>    `(setq last-kbd-macro (kbd ,(format-kbd-macro last-kbd-macro)))))
> 
> it's roughly the trick that I use to save and edit keyboard macros,
> but stripped out of all the cruft...
>    Cheers,
>      Eduardo Ochs
>      http://anggtwu.net/#eev

Thank you for the response. I know that the variable `last-kbd-macro` 
contains the last keyboard macro that was defined, but I am interested 
in programmatically knowing the last keyboard macro that was run, just 
after it is run.

For example, `consult-kmacro` selects a keyboard macro from 
`kmacro-ring`, converts that macro to a function, and then runs 
function. In this way, it does not change the value of `last-kbd-macro`, 
as far as I'm aware.






reply via email to

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