emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convert a keyboard macro to equivalent Lisp code


From: Stefan Monnier
Subject: Re: Convert a keyboard macro to equivalent Lisp code
Date: Mon, 07 Jun 2010 16:11:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> To get useful results, some commands should provide their arguments
> explicitly in the interactive spec instead of relying on global
> variables.  So instead of useless `(self-insert-command 1)' typing `A'
> will record `(self-insert-command 1 65)' with the following patch.
> The same is for isearch.

This will break all Elisp calls to self-insert-command (grep finds more
than 100 of them in lisp/**/*.el) ;-(

So I think it's not an option.  Better would be to have your
command-recording code provide hooks such that commands like
self-insert-command can teach it how to turn them into Elisp code (in
the case of self-insert-command it should probably use `insert').

Of course, even better would be if the code run during macro recording
is the code generated (so if the behavior is different from the normal
command's behavior, you might see it during recording).


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]