From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: How to define a `multiple prompt' function? Date: Wed, 03 Sep 2008 00:08:19 -0400 Message-ID: References: <87ej42m64o.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1220416889 15087 80.91.229.12 (3 Sep 2008 04:41:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2008 04:41:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 03 06:42:23 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KakCD-00049G-9c for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Sep 2008 06:42:21 +0200 Original-Received: from localhost ([127.0.0.1]:59051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KakBC-0007HL-T7 for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Sep 2008 00:41:18 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Tue, 02 Sep 2008 23:08:19 -0500 Original-Newsgroups: gnu.emacs.help Mail-Copies-To: nobody User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Original-Lines: 34 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 24.34.108.171 Original-X-Trace: sv3-HBmKm2jcz+L+6Sde0QUuZZLHcpRSD4ESm5HMIALqJfZFnHd+IKL4LJdXNdb/mR1tJq0+L5JywozS3MB!419uhqu99yirHcpYglgf5QQmYYESYClHGtQTXgfNqzJgb2NaLa86jDVJi2H8bb6jovfpdhFROiv3!Rw5bM+NO03iKSFI+X8dVGDHlG9uiZpv6uzIaMvQ= Original-X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Original-Xref: news.stanford.edu gnu.emacs.help:161861 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57204 Archived-At: In article <87ej42m64o.fsf@gmail.com>, Rodolfo Medina wrote: > I wish to define a function that prompts me more than once: let's call it > `my-function': when I type `M-x my-function', in the echo area I see (just an > example): > > Hi, how are you today? > > . Then I type, e.g., `fine RET', and again it prompts me with: > > I see. And, what did you do yesterday? > > ... and so on. Then I'm going to put some `if... else' conditions over my > possible answers. Can anybody please provide some hints about how to elisp > this? > > Thanks for any help > Rodolfo (defun my-function () (interactive) (let* ((response (read-from-minibuffer "Hi, how are you today? ")) (new-prompt (format "I see, you're %s? And where did you go yesterday?" response)) (response2 (read-from-minibuffer new-prompt))) (message "I hope you enjoyed %s" response2))) -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***