🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.emacs
Article #9554

Re: Need read-number function

#9554
From: Randal Schwartz
Date: Thu, 08 Feb 1990 19:36
25 lines
1641 bytes
In article <1990Feb8.132524.1694@talos.uu.net>, kjones@talos (Kyle Jones) writes:
|  > I need a function read-number that would behave like (interactive "n");
|  > that is, it would keep trying until a numeric value was typed.
| [ Assuming GNU emacs here... ]
| Yah, I had to code this one myself.  I don't know if a function like
| this should be standard in the distribution or not.  Common Lisp's
| elephantiasis is largely due to adopting functions from everyone's
| toolbox.
[code deleted]

why not just:

(defun rls-read-number ()
  "read a number from the keyboard"
  (call-interactively
   (function (lambda (arg) (interactive "n") arg))))

Okay, so, it's cheating. :-)

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!"=/
Technical Details
Message-ID: <1990Feb8.193601.10581@iwarp.intel.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!apple!oliveb!orc!mipos3!iwarp.intel.com!news
References: <4300068@m.cs.uiuc.edu> <1990Feb8.132524.1694@talos.uu.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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
Keywords: GNU EMACS
Message-ID: <1990Feb8.193601.10581@iwarp.intel.com>
Date: 8 Feb 90 19:36:01 GMT
References: <4300068@m.cs.uiuc.edu> <1990Feb8.132524.1694@talos.uu.net>
Sender: news@iwarp.intel.com
Reply-To: merlyn@iwarp.intel.com (Randal Schwartz)
Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA
Lines: 25
In-Reply-To: kjones@talos.uu.net (Kyle Jones)