-   Linux - Software (
-   -   Emacs: Permanent Key Binding For Saved Macro (

CoderMan 11-27-2009 03:54 AM

Emacs: Permanent Key Binding For Saved Macro
Hi. I would appreciate some help from the Emacs gurus. I was trying to follow an online tutorial on how to permanently save a macro for reuse. So I tried to follow the instructions, and ended up putting this in my .emacs:


(fset 'texquote
  (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("\\begin{quotation}^M^M^M^M\\end{quotation}^[OA^[OA" 0 "%d")) arg)))

This works great in that it makes available my macro as the "texquote" command, but it does not also make available the key-binding I attached to the command, which was "C-x C-k 1".

The tutorial says:


If you give insert-kbd-macro a numeric argument, it makes additional Lisp code to record the keys (if any) that you have bound to macroname, so that the macro will be reassigned the same keys when you load the file.
I think this is where I went wrong, but when I try to use "M-x insert-kdb-macro 1" it just says that there is no macro by that name. What does it mean then when it says to "give insert-kbd-macro a numeric argument"?

All times are GMT -5. The time now is 06:03 PM.