Note to self: Emacs macros

Shortcut Meaning
C-x ( starts macro recording
C-x ) finishes macro recording
C-x e executes a recorded macro
C-u *number* C-x e executes the macro number times

Example: C-x ( C-w \ e m p h { C-y } C-x ) This surrounds the selected region with \emph{} (a LaTeX command) and places the cursor after the closing bracket.


Also have a look at the Emacs wiki's page on this and that nice article with video tutorial on that weblog on Emacs.