Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!bu.edu!bu-cs!snorkelwacker!usc!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!swrinde!ucsd!ucbvax!hplabs!otter!hplb!anorman!ange From: ange@hplb.hpl.hp.com (Andy Norman) Newsgroups: comp.emacs Subject: Re: Need read-number function Message-ID: Date: 8 Feb 90 16:04:19 GMT References: <4300068@m.cs.uiuc.edu> Sender: news@hplb.hpl.hp.com Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 24 In-reply-to: reingold@m.cs.uiuc.edu's message of 8 Feb 90 01:40:30 GMT >>>>> On 8 Feb 90 01:40:30 GMT, reingold@m.cs.uiuc.edu said: ed> I need a function read-number that would behave like (interactive "n"); ed> that is, it would keep trying until a numeric value was typed. Well, this is absolutely disgusting, but it might do what you want: (defun read-number (&optional prompt) (call-interactively (list 'lambda '(num) (list 'interactive (concat "n" prompt)) 'num))) If you don't want a prompt, it becomes much easier: (defun read-number () (call-interactively '(lambda (num) (interactive "n") num))) Hope this helps... -- -- ange -- ange@hplb.hpl.hp.com