Saving macros defined on-the-fly (F3, F4)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving macros defined on-the-fly (F3, F4)

jonetsu
Hello,

On Linux systems, is it possible to save a macro quickly defined using
F3 and F4 and have it recalled at a later time and run by pressing
F4 ?

Cheers.

Reply | Threaded
Open this post in threaded view
|

Re: Saving macros defined on-the-fly (F3, F4)

Skip Montanaro
> On Linux systems, is it possible to save a macro quickly defined using
> F3 and F4 and have it recalled at a later time and run by pressing
> F4 ?

Been awhile since I wanted to save (or even name) a keyboard macro, but try

C-x C-k n

to give it a name, or

C-x C-k b

to bind it to a key sequence. Once named, you can save its definition
across sessions with

M-x insert-kbd-macro RET

to insert it in the current buffer (typically one visiting ~/.emacs).

Not sure about the F3/F4 business. Those two keys have nothing to do
with macros in my world. I still use C-x ( and C-X ) (old habits die
hard). I presume somewhere in your setup you bound F3 and F4 to
commands which start and end macro definitions. At any rate, you can
read all about messing with macros here:

http://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html#Keyboard-Macros

Skip

Reply | Threaded
Open this post in threaded view
|

Re: Saving macros defined on-the-fly (F3, F4)

Gregor Zattler
In reply to this post by jonetsu
Hi,
* jonetsu <[hidden email]> [2019-01-22; 16:27]:
> On Linux systems, is it possible to save a macro quickly defined using
> F3 and F4 and have it recalled at a later time and run by pressing
> F4 ?

It's possible to name, save and later load macros.  See:
(info "(Emacs)Save Keyboard Macro")

[position the cursor after the last ")" and press C-x C-e]

Ciao; Gregor
--
 -... --- .-. . -.. ..--.. ...-.-