Path: utzoo!attcan!uunet!snorkelwacker!apple!oliveb!orc!mipos3!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.emacs Subject: Re: Need read-number function Message-ID: <1990Feb8.194148.10668@iwarp.intel.com> Date: 8 Feb 90 19:41:48 GMT References: <4300068@m.cs.uiuc.edu> <13690@phoenix.Princeton.EDU> <51906@bbn.COM> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 27 In-Reply-To: jr@bbn.com (John Robinson) In article <51906@bbn.COM>, jr@bbn (John Robinson) writes: | ... and there is no easy way to pass it a prompt at run time. For | that, you would probably want to replace the defined function in the | call-interactively with a lambda-expression, but I'm not sure it is | possible to get the (interactive) part right if you do. Or (ugh) | evaluate the defun inside the caller... Ooops. I should read *all* my news before posting. Anyway, to get a prompt into the thing, try: (defun rls-read-number (prompt) "read a number from the keyboard, with PROMPT for a prompt" (call-interactively (list 'lambda '(arg) (list 'interactive (concat "n" prompt)) 'arg))) It seems to work for me. But, I only tested it once! :-) Just another GNU Emacs hacker, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/