unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: PJ Weisberg <pj@irregularexpressions.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Convert an existing keyboard macro to elisp code?
Date: Sat, 4 Aug 2012 00:00:40 +0700	[thread overview]
Message-ID: <CAP_d_8VJy4fjfeFr4ssOBh35rxiNxj=cAJTaJg+DEfejcf9atw@mail.gmail.com> (raw)
In-Reply-To: <CAJsNXT=86=O+Q5CYi-+WYjvqkRYYtVE1dZOq2hNnrx3P02uW1Q@mail.gmail.com>

On Fri, Aug 3, 2012 at 11:33 PM, PJ Weisberg
<pj@irregularexpressions.net> wrote:

> If it were just a matter of reading the key sequence and mapping it to
> functions it wouldn't be too bad, but the more I think about this, the
> more it seems like a rat hole.  How would you translate
>
> (fset 'my-macro
>    [?\M-x ?m ?a ?g tab ?i ?t tab ?s ?t tab ?t tab return ?m ?a tab return])

Additionally, a macro may switch the currently active mode, e.g. by
visiting a new file or switching windows/frames/buffers. The
translating code won’t see it without actually executing the macro.
No, this facility has to be in the core to be any effective.

And, it works that way in (gasp!) Word and Excel, and I can say it is
not at all always what is wanted. E.g. a dumb purely key-based macro
can initiate a command that wants further user input and finish,
leaving it up to the user to deal with that interactively. A smart
macro, however, is incomplete until the user completes the additional
input (e.g. by clicking OK in an Excel find-and-replace dialog) — as
far as the macro recorder is concerned, you haven’t even started doing
anything yet; if your intent was to open a dialog with a few fields
pre-populated with some specific values, tough luck.



  reply	other threads:[~2012-08-03 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03 15:10 Convert an existing keyboard macro to elisp code? Thorsten Jolitz
2012-08-03 16:33 ` PJ Weisberg
2012-08-03 17:00   ` Yuri Khan [this message]
2012-08-03 18:16   ` Thorsten Jolitz
2012-08-04  6:13   ` Andreas Röhler
     [not found] ` <mailman.6259.1344011630.855.help-gnu-emacs@gnu.org>
2012-08-04  9:48   ` Raffaele Ricciardi
2012-08-04 16:39     ` Thorsten Jolitz
2012-08-04 16:51 ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP_d_8VJy4fjfeFr4ssOBh35rxiNxj=cAJTaJg+DEfejcf9atw@mail.gmail.com' \
    --to=yuri.v.khan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=pj@irregularexpressions.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).