Emacs Macros and Keybindings
Usually, for quick hacks, its easier to define a keyboard macro in Emacs than create a custom Emacs Lisp function. If you want that macro to persist and be easily usable via a key binding, the usual advice is to do something like: (defalias 'seach-and-replace (kmacro "M-x replace-string C-m misspeling C-m misspelling")) (global-set-key (kbd "C-c C-f") 'search-and-replace) That does work, but it can end up polluting your .emacs file with a bunch of extra lines and, given the global nature of Emacs Lisp variables, provides an opportunity for a name collision.
read more...
Tags: emacs emacs lisp