[Download postscript version]
Next: .emacs File
Up: Emacs
Previous: Etags
Keyboard macros are really easy to write and they can save a great
amount of time. Using the registers for file positions or text, the
search and jump functions described above, you can write powerful
macros that, for example, collect information in different files and
write them to another file. Useful macros can be saved in the .emacs
file and assigned to a key shortcut. Table 7
summarizes the most useful commands.
Macro |
Key, Action | Explanation |
C-x ( |
Start recording a keyboard macro |
C-x ) |
End the recording |
C-x e |
Calls the last created macro |
M-x name-last-kbd-macro |
Assigns a name to last created keyboard macro. This is necessary, if
you would like to insert the macro into a buffer (or into the .emacs
file). |
M-x insert-kbd-macro |
Inserts the keyboard macro into the current buffer. Usually, when a
useful macro was created and inserted into the .emacs, a keyboard
redefinition such as (global-set-key " C-cn"
'prototype_to_function) is very useful. |
Table 7:
Adrian Perrig
Wed Jun 12 00:18:25 MET DST 1996