From: gentsquash <gentsquash@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Interactive-form invoked with specified arg
Date: Tue, 4 Jun 2013 16:20:11 -0700 (PDT) [thread overview]
Message-ID: <0e2b4b33-4752-41b2-b08c-4299cbe57440@20g2000yqe.googlegroups.com> (raw)
In-Reply-To: 87wqq94wz5.fsf@VLAN-3434.student.uu.se
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
next prev parent reply other threads:[~2013-06-04 23:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 16:31 Interactive-form invoked with specified arg gentsquash
2013-06-04 17:17 ` Emanuel Berg
2013-06-04 23:20 ` gentsquash [this message]
2013-06-04 23:53 ` Emanuel Berg
2013-06-05 2:45 ` Stefan Monnier
[not found] ` <mailman.1012.1370400616.22516.help-gnu-emacs@gnu.org>
2013-06-05 16:49 ` gentsquash
2013-06-05 17:18 ` gentsquash
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=0e2b4b33-4752-41b2-b08c-4299cbe57440@20g2000yqe.googlegroups.com \
--to=gentsquash@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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).