LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Emacs: Permanent Key Binding For Saved Macro (https://www.linuxquestions.org/questions/linux-software-2/emacs-permanent-key-binding-for-saved-macro-771863/)

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:

Code:

(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:

Quote:

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.