Very frequently I would need to perform the set of steps requiring multiple key strokes. For the same session those steps can be recorded in a keyboard macro.
An example is saving a frequently executed search/replace operation as a keyboard macro. But that macro is lost when I quit emacs.
How can I save my frequently used keyboard macro as a Lisp function?
For the sake of simplicity, I want to save the action of replacing "abc" with "def" as a function so that I can reuse it across emacs sessions.