[Top][All Lists]
[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: |
Tue, 08 Jun 2010 21:36:30 -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) ;-(
> I don't understand how it breaks Elisp calls.
The part you don't understand is that I only noticed your
> if (NILP (last_char))
> last_char = last_command_event;
right *after* sending my email.
>> 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).
> We could later add an option to verify to macro during recording.
I'm heading towards a special "recording&running macro" mode where
various commands may have a slightly different behavior (less DWIMish,
more amenable to scripting, more amenable to transforming into Elisp
code), so "verifying" might not be the right approach since a different
behavior might not be a problem but a feature.
Stefan