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

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

Re: newbie : elisp - prompt for input


From: Hadron Quark
Subject: Re: newbie : elisp - prompt for input
Date: Mon, 28 Aug 2006 23:15:49 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Hadron Quark wrote:
>> Is the snippet below the best way to prompt and parse an integer value?
>>
>>
>> (defun count-words(max)
>>   "count words in buffer"
>>   (interactive "nMax words to count to:")
>>   (while (zerop max)
>>     (setq max (string-to-number(read-string "> 0 please. re-enter:"))))
>
> The only thing I see wrong with it is that the check runs outside
> of the interactive form, and prompts the user (regardless of whether
> the function was called interactively).

Youve lost me : what do you mean "outside of the interactive form" - the
whole function is an interactive form isnt it?


reply via email to

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