* keyboard macro syntax
@ 2009-12-11 17:28 harven
2009-12-13 9:34 ` Andreas Röhler
0 siblings, 1 reply; 2+ messages in thread
From: harven @ 2009-12-11 17:28 UTC (permalink / raw
To: help-gnu-emacs
There seems to be two different syntaxes for keyboard macros,
depending whether they are named using the commands
name-last-kbd-macro or kmacro-name-last-macro e.g.
(fset 'hello1
[?\C-s ?h ?e ?l ?l ?o ?\C-m ?, ? ?w ?o ?r ?l ?d ?! ?\C-u ?\C- ])
(fset 'hello2
(lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([19 104 101 108 108 111 13 44 119 111 114 108 100 33 21 67108896] 0 "%d")) arg)))
Anyone knows why ?
The first one is more readable but I suspect the second one is the preferred one
since it is granted a keybinding (C-x C-k n).
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: keyboard macro syntax
2009-12-11 17:28 keyboard macro syntax harven
@ 2009-12-13 9:34 ` Andreas Röhler
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Röhler @ 2009-12-13 9:34 UTC (permalink / raw
To: help-gnu-emacs
harven wrote:
> There seems to be two different syntaxes for keyboard macros,
> depending whether they are named using the commands
> name-last-kbd-macro or kmacro-name-last-macro e.g.
>
> (fset 'hello1
> [?\C-s ?h ?e ?l ?l ?o ?\C-m ?, ? ?w ?o ?r ?l ?d ?! ?\C-u ?\C- ])
>
> (fset 'hello2
> (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([19 104 101 108 108 111 13 44 119 111 114 108 100 33 21 67108896] 0 "%d")) arg)))
>
> Anyone knows why ?
>
> The first one is more readable but I suspect the second one is the preferred one
> since it is granted a keybinding (C-x C-k n).
>
Hi,
a more general remark: storing keyboard macros is useful for
simple tasks.
If you reach the point to edit your macro, it's
usually much faster to write your own functions. So far my experience.
Andreas
--
https://code.launchpad.net/s-x-emacs-werkstatt/
http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-13 9:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11 17:28 keyboard macro syntax harven
2009-12-13 9:34 ` Andreas Röhler
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.