Saving Emacs macros

Jurjen Bokma

April 2010


  1. From the Macros section of the Emacs Wiki:

    M-x name-last-kbd-macro

  2. M-x global-set-key

    (... and type key and choose macro by name.)

  3. From the EmacsWiki Macro tricks:

    M-x insert-kbd-macro

    (... and fill in the name of the macro.) Then write the output to your ~/.emacsrc, together with a key binding, like this:

    (fset '<snip>
    (global-set-key (kbd "C-x i") 'indexterm-primary-secondary)