[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: |
Wed, 5 Jun 2013 10:18:11 -0700 (PDT) |
User-agent: |
G2/1.0 |
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