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: Drew Adams
Subject: RE: Is there a plan to record kbd macro as elisp code?
Date: Sat, 27 Oct 2007 09:20:10 -0700

> Recording kbd macro as elisp code can be useful. The following are some
> benefits:
> 1. Editing elisp code is more clear than editing key sequences,
> and supports complex controlstructures.
> 2. elisp code is more portable than key sequences. Sharing with
> others who have different key bindings is ok for elisp, but not
> for key sequences.
> 3. It can be used as a means ot learn emacs commands in elisp form.
>
> I tried to build a modified emacs that stores every command sent to
> 'execute-command' into a list, when 'defining-kbd-macro' is on. But the
> result is a list that still leaves out things like horizontal movements.
> And isearch is not recorded right (one search recorded as many isearch
> commands, without information of what's being searched).
>
> So I know the modification required is not simple, far beyond a quick and
> dirty patch.
>
> Out of curiosity I want to know whether there is a plan for this
> feature in the future.

IIRC, there used to be such a feature, bound to `C-x [' and `C-x ]' I think.
It generated Elisp for the defined macro. Worked pretty well - gave you at
least a skeleton you could complete to make a proper command definition.

Unless it was in Epoch or Gosling Emacs. It's been a while...

I think the command name was `gen-' something, but I can't find anything
about this in Google - perhaps I'm not a good googler.

The Emacs Lisp List has this entry, but the link appears to be dead:
macro-generate.el --- [Turn a keyboard macro into lisp code.] Contact:
[unknown]. Perhaps that was what I was thinking of. This is the (dead?) URL:
http://www.dtek.chalmers.se/~d3rydma/Hack/emacs/Archive/macro-generate.el.

And this page (http://www.bookshelf.jp/soft/meadow_46.html#SEC669) mentions
in connection with macro-generate.el, commands `gen-start-generating',
`gen-stop-generating', and `gen-expand-macro'. I think this was what I used
to use. Perhaps you can find it somewhere else on the Web - I couldn't.





reply via email to

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