emacs-devel
[Top][All Lists]
Advanced

[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: Juri Linkov
Subject: Re: Is there a plan to record kbd macro as elisp code?
Date: Sun, 28 Oct 2007 03:34:46 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> OTOH I do expect that it can be very tricky to recover the structure from
> just the key sequence: e.g. after a keybinding that may or may not present
> a minibuffer prompt, figuring out whether the rest of the keys were sent to
> the minibuffer or to the next command can be impossible without guessing.

Yes, and in the converted Lisp programs emulating the logic of minibuffer
processing is useless.  What would be useful to generate in Lisp programs
are executed commands with their arguments no matter how these arguments
were specified by the user.

> This doesn't sound too bad.  Another approach would be to advise
> `call-interactively'.
>
> This may require changes at the C level so as to make sure that calls to
> Fcall_interactively are never made directly but always go through the
> `call-interactively' symbol.
>
> With an exhaustive around advice on call-interactively, you should be
> able to get a fairly reliable trace.

But `call-interactively' doesn't have an argument that contains the
arguments of the called command.  I think we should avoid generating
Lisp code that read command arguments.

> But even a reliable trace will encounter the problems mentioned by Kim, and
> in order to get /good/ Elisp code (rather than just /working/ Elisp code),
> a fair bit of post-processing will be needed with ad-hoc rewrites.

I think the goal is not to produce Lisp code exactly equivalent to the
keyboard macro, but a useful basis for writing a new Lisp function.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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