LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-27-2009, 03:54 AM   #1
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
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"?

Last edited by CoderMan; 11-27-2009 at 03:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alt no longer META key when using in-terminal option of Emacs (emacs -nw) frznchckn Linux - Software 1 06-02-2007 02:41 AM
Key Binding LDMohican Linux - Newbie 0 03-06-2006 10:52 AM
Key Binding mtecknology Linux - Software 0 07-28-2005 09:50 AM
Lisp/Emacs: How to do a macro on a buffer-name with another extension LuisG Linux - Software 3 10-25-2004 09:26 PM
key binding? granny Linux - Newbie 2 03-11-2003 09:42 AM


All times are GMT -5. The time now is 04:58 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration