[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Convert an existing keyboard macro to elisp code?
From: |
Thorsten Jolitz |
Subject: |
Convert an existing keyboard macro to elisp code? |
Date: |
Fri, 03 Aug 2012 17:10:42 +0200 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) |
Hi List,
I cite from the http://www.emacswiki.org/emacs/KeyboardMacrosTricks
page, where somebody posted exactly the same question that came to my
mind today:
,-------------------------------------------------------------------
| Is there a way to convert an existing keyboard macro to elisp code?
|
| You can do this with M-x insert-kbd-macro but the result is
| probably not to your liking. If I do:
|
| C-x (
| C-n
| foo
| C-x )
| M-x name-last-kbd-macro RET newline-and-foo
| M-x insert-kbd-macro RET newline-and-foo RET
|
| emacs will insert the following into the buffer:
|
| (fset 'newline-and-foo
| "\C-nfoo")
|
| I would very much like to be able to insert something like this:
|
| (defun newline-and-foo ()
| (interactive)
| (next-line)
| (insert "foo"))
|
| But it appears emacs does not have this feature.
`-------------------------------------------------------------------
Unfortunately, the answer was more a less a 'NO'(or 'YOU HAVE TO WRITE
IT YOURSELF').
Since Emacs is a pretty dynamic project, I thought I give it another try
on the mailing list - maybe this feature request has been implemented in
the meantime by somebody?
--
cheers,
Thorsten