Sams Teach Yourself Emacs in 24 Hours

ContentsIndex

Hour 13: Macros

Previous HourNext Hour

Sections in this Hour:

 

Summary

You have now learned to create macros; so start using them! In the beginning it might take more time to create the macros than they will save you, but remember the following:

Table 13.1 lists the functions that were described in this hour.

Table 13.1  Functions Concerning Macros

Default Keybindings

Function Name

Description

C-x (

start-kbd-macro

Start recording a macro. If you give it a numeric prefix (C-u), you instead continue the previous macro recorded.

C-x )

end-kbd-macro

Stop recording a macro.

C-x e

call-last-kbd-macro

Execute the macro recently defined.

M-x

name-last-kbd-macro

Give a name to the most recent defined macro.

M-x

sams-apply-macro-on-region

Run a macro on a region until point is outside the region after an iteration.

C-x q

(kbd-macro-query)

Make the macro ask the user for permission to continue. Given a numeric prefix (C-u), the macro instead enters recursive editing, which lets you type some text before the macro continues.

C-x k

edit-kbd-macro

This asks you for a keyboard macro to edit and places you in a buffer with the macro in a readable form.

M-C-c

exit-recursive-edit

When the macro pauses for your editing (that is, in recursive-edit) pressing M-C-c continues the macro.


Sams Teach Yourself Emacs in 24 Hours

ContentsIndex

Hour 13: Macros

Previous HourNext Hour

Sections in this Hour: