From: gentsquash <gentsquash@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Interactive-form invoked with specified arg
Date: Wed, 5 Jun 2013 10:18:11 -0700 (PDT) [thread overview]
Message-ID: <07632cb9-0f46-4086-bfa2-5ea07bd87758@qz2g2000pbb.googlegroups.com> (raw)
In-Reply-To: a0b35c0c-13cd-4c15-8030-4e296324c299@g3g2000yqg.googlegroups.com
Making Stefan's solution a macro, I am now using
this in my code:
(defmacro invoke-with-typing (FORM &rest CHARS)
"JK:05Jun2013: Executes FORM, which would normally prompt
the user for input. Here, CHARS are characters sent to the
form, as-if the user had typed them.
USAGE: (invoke-with-typing (query-replace \"wierd\" \"STRANGE\") ?y ?
n ?! )
will replace the first occurrence of \"wierd\", not the second,
and
all the remaining occurrences
Note that FORM needs to be a form, rather than evaluate to a form."
`(let ((unread-command-events ',CHARS)) ,FORM)
)
--Jonathan
prev parent reply other threads:[~2013-06-05 17:18 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07632cb9-0f46-4086-bfa2-5ea07bd87758@qz2g2000pbb.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.