[Top][All Lists]

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

Re: Is there a plan to record kbd macro as elisp code?

From: Kim F. Storm
Subject: Re: Is there a plan to record kbd macro as elisp code?
Date: Sat, 27 Oct 2007 23:22:22 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> Thank you for your appreciation. But my modification is in the C code of 
>> emacs, because 'execute-command' and 'call-interactively' are in C code.
>> And I don't think my dirty code would be a valid patch for the emacs 
>> developers.
> I think what was expected was to first record a keyboard macro and later to
> turn that into elisp code.  Another approach is to use a pre-command-hook to
> record the value of `this-command' for each command run.

Which reminds me that there is a big difference between replaying a keyboard
macro and running the corresponding functions as a single command:

- the pre-command-hook and post-command-hook are run for each key in
the keyboard macro, but only once for the single command.

This doesn't mean that the elisp code cannot be equivalent to the keyboard
macro, but it may be much harder to do right.  E.g. if you use modes
like delete-selection-mode or cua-mode which do major work in the hooks.

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

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