Sunday, October 17, 2010

emacs cool cookbook

autoindent regionESC - C - \

how to use macros in emacs

C-x (  to start recording your macro
C-x ) to save your macro

C-x C-k n

Give a command name (kmacro-name-last-macro). 
C-x C-k b
Bind the most recently defined keyboard macro to a key sequence (kmacro-bind-to-key). 

M-x insert-kbd-macro

Insert in the buffer a keyboard macro's definition, as Lisp code.

this will be available while your macro session is running, once killing it you need to recreate your macro.
Sometimes this is good because is a simple and very special thing you want to do right away.

Once the activity is kind of repetitive on regular basis, It's time to understand how to save it: