help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Interactive-form invoked with specified arg


From: gentsquash
Subject: Re: Interactive-form invoked with specified arg
Date: Tue, 4 Jun 2013 16:20:11 -0700 (PDT)
User-agent: G2/1.0

On Jun 4, 1:17pm, Emanuel Berg <embe8...@student.uu.se> wrote:

> ... intuitively, emulate typing seems a bit strange...

Not to me.   Keyboard macros are a mechanism to convert
typed-actions into programmatic code.  E.g, I could use

    (execute-kbd-macro
     [?\M-x ?q ?u ?e ?r ?y ?- ?r ?e ?p ?l ?a ?c ?e return ?a ?t
return ?@ return ?!] )

in place of my desired

    (invoke-as-if-I-typed (query-replace "at" "@") "!")

However, firstly, this is clumsy.  Secondly, it
doesn't allow me to pass-in the fnc-name,
e.g sometimes `query-replace',
sometimes `query-replace-regexp',
sometimes `dired-do-query-replace-regexp'.

> ...
> You might check out `C-h f call-interactively'.

I looked at it before I posted.  If someone can explain to me
how it does what I want, then I'll be grateful.

As to why I seek `invoke-as-if-I-typed', there are
many reasons, but here is one.  Imagine a fnc FOO that
sequentially invokes a bunch of fncs that will
prompt the user.  While debugging FOO, I'd like to
make some of the branches in the execution tree [the
tree is controlled by user-input] to be executed
automatically, while I debug the other parts.

                       -Jonathan


reply via email to

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