From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rodolfo Medina Newsgroups: gmane.emacs.help Subject: `are-you-fine' function definition (was: ps-print variables interactive setting) Date: Thu, 04 Sep 2008 18:24:25 +0100 Organization: SunSITE.dk - Supporting Open source Message-ID: <87zlmnzuwm.fsf@gmail.com> References: <87ej42m64o.fsf@gmail.com> <87ej412cpw.fsf@gmail.com> <1220481354.252639@arno.fh-trier.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220546510 23742 80.91.229.12 (4 Sep 2008 16:41:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Sep 2008 16:41:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 04 18:42:45 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 1KbHul-0003Gc-PU for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Sep 2008 18:42:36 +0200 Original-Received: from localhost ([127.0.0.1]:51179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbHtl-0003eo-T9 for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Sep 2008 12:41:33 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.stanford.edu!goblin1!goblin2!goblin.stu.neva.ru!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:EgzWp7LkCvSNgf4G5g/6r1ZpzVM= Original-Lines: 63 Original-NNTP-Posting-Host: 151.80.24.214 Original-X-Trace: news.sunsite.dk DXC=Gb0GK\5E[I; :AocXk=\=_4T7bXfBO; G:5KAib\KDO`h2m=c5DAkLCD<<4HWK9JcIc?Q0Y`PeBnYo2 Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:161928 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:57271 Archived-At: Rodolfo Medina wrote: >>>> I wish to define a function that prompts me more than once >>>> >>>> [...] >>>> >>>> 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? Barry Margolin writes: >>> (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))) "Lennart Borgman (gmail)" writes: > Maybe like this > > (defun my-manage-ps-font-size () > (interactive) > (let ((font-size (read-number "Font size? "))) > (setq ps-font-size (cons 7 font-size)))) Andreas Politz writes: > Take a look at the documentation of the interactive call, it let's you > read any kind of data from the minibuffer. > > (defun my-manage-ps-font-size(size string) > (interactive "nFont size ? \nsErase all memory ? ") > (setq ps-font-size (cons 7 size))) > > This reads a number and a string. Thanks very much to all who helped. With their help I'm building a `my-ps-print-buffer' function, that I'll report so that it may be useful to others: now I need something like this: the function says: Are you fine today? . If I say `y', it says: `Oh, good.'; otherwise it says: `Why don't you see a doctor?' I tried a lot but don't manage by myself. Please help in this regard Thanks again Rodolfo