|
From: | Kevin Rodgers |
Subject: | Re: newbie : elisp - prompt for input |
Date: | Mon, 28 Aug 2006 15:07:49 -0600 |
User-agent: | Thunderbird 1.5.0.5 (Windows/20060719) |
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). -- Kevin
[Prev in Thread] | Current Thread | [Next in Thread] |