help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `are-you-fine' function definition


From: Kevin Rodgers
Subject: Re: `are-you-fine' function definition
Date: Thu, 04 Sep 2008 20:18:40 -0600
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

Rodolfo Medina wrote:
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?'

(if (equal (read-string "Are you fine today? ") "y")
    (message "Oh, good.")
  (message "Why don't you see a doctor?"))

You might want to change the (equal ...) test to one of these:

(y-or-n-p "Are you fine today? ")

(yes-or-no-p "Are you fine today? ")

(let ((case-fold-search t))
  (string-match "\\`y\\(es\\)?\\'" (read-string "Are you fine today? ")))

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]