[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`are-you-fine' function definition (was: ps-print variables interactive
From: |
Rodolfo Medina |
Subject: |
`are-you-fine' function definition (was: ps-print variables interactive setting) |
Date: |
Thu, 04 Sep 2008 18:24:25 +0100 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.0.50 (gnu/linux) |
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 <barmar@alum.mit.edu> 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)" <lennart.borgman@gmail.com> 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 <politza@fh-trier.de> 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
- How to define a `multiple prompt' function?, Rodolfo Medina, 2008/09/02
- Re: How to define a `multiple prompt' function?, Barry Margolin, 2008/09/03
- ps-print variables interactive setting (was: How to define a `multiple prompt' function?), Rodolfo Medina, 2008/09/03
- Re: ps-print variables interactive setting, Lennart Borgman (gmail), 2008/09/03
- Re: ps-print variables interactive setting, Andreas Politz, 2008/09/03
- `are-you-fine' function definition (was: ps-print variables interactive setting),
Rodolfo Medina <=
- Re: `are-you-fine' function definition, Kevin Rodgers, 2008/09/04
- Message not available
- Re: `are-you-fine' function definition, Rodolfo Medina, 2008/09/06
- `y-or-n-p' function definition (was: `are-you-fine' function definition), Rodolfo Medina, 2008/09/06
- Re: `y-or-n-p' function definition, Nikolaj Schumacher, 2008/09/08
- ps-right-footer interactive setting (was: ps-print variables interactive setting), Rodolfo Medina, 2008/09/04
- Re: ps-right-footer interactive setting (was: ps-print variables interactive setting), Barry Margolin, 2008/09/04
- Re: ps-right-footer interactive setting, Rodolfo Medina, 2008/09/05
- Re: ps-right-footer interactive setting, Chetan, 2008/09/05
- Re: ps-right-footer interactive setting, Rodolfo Medina, 2008/09/06
- A `my-ps-print-setting' function (was: ps-print variables interactive setting), Rodolfo Medina, 2008/09/07