From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hadron Quark Newsgroups: gmane.emacs.help Subject: Re: newbie : elisp - prompt for input Date: Mon, 28 Aug 2006 23:15:49 +0200 Message-ID: <87y7t836ka.fsf@mail.com> References: <87irkc4ql6.fsf@mail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156801297 30294 80.91.229.2 (28 Aug 2006 21:41:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Aug 2006 21:41:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 28 23:41:36 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GHorP-0006bZ-Ua for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Aug 2006 23:41:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GHorP-0005mw-Gq for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Aug 2006 17:41:35 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 18 Original-X-Trace: individual.net FYnkfHIGETKKiS/KB1P+Kg8qioD+DFz20TyckrwvLYGKe4AENz X-Orig-Path: news.ibm.net!news X-Face: 2h#||Cd#d%F*NCm59[_6/{1a@jy%; |j>{D~4^gKg(^i%7j0IK?+,/GmW&:CD5fEKb_! User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:T4O6WMcL5sy8zhRE7WJGBufeqIw= Original-Xref: shelby.stanford.edu gnu.emacs.help:141387 Original-To: help-gnu-emacs@gnu.org 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:37009 Archived-At: Kevin Rodgers 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?