home *** CD-ROM | disk | FTP | other *** search
- x-gateway: rodan.UU.NET from bug-lucid-emacs to alt.lucid-emacs.bug; Tue, 5 Jan 1993 15:59:05 EST
- Date: Tue, 5 Jan 1993 12:55:13 PST
- Message-ID: <9301052055.AA18807@thalidomide.lucid>
- X-Windows: A terminal disease.
- From: jwz@lucid.com (Jamie Zawinski)
- Sender: jwz%thalidomide@lucid.com
- Subject: Re: Shouldn't the audio part be moved out of lemacs?
- References: <9301051623.AA17021@geant.cenatls.cena.dgac.fr>
- <Pine.3.05.9301051114.B17104-b100000@trillian>
- Newsgroups: alt.lucid-emacs.bug
- Path: sparky!uunet!wendy-fate.uu.net!bug-lucid-emacs
- Lines: 37
-
- The reason I built the audio code into emacs instead of just forking whatever
- "play" program the system provides is that playing sounds is different from
- something like ispell in that emacs plays sounds as part of its error-handling
- routines. because of the time-criticalness of this, I don't want emacs to
- have to access the file system to play a sound. Execing "play" would mean at
- least two accesses: getting the play executable (actually this would probably
- be dozens, since it would have to search the path) and then reading the sound
- file. Getting NFS lossage just because you typed ^G would be very bad news.
-
- > One solution would be to use a interface similar to "ispell". Last night I
- > hacked up a simple program "eplay" which waits for the name of a sound
- > file, opens the audio port, plays it, closes the audio port and loops back
- > to the beginning.
-
- This sort of thing would be ok, if you could hand it sound data instead of
- just a filename, but the system doesn't provide such a program: you'd have to
- write the audio-handling code yourself, which is the hard part. So why not
- just link it in to emacs directly and avoid the overhead of having to fork a
- process?
-
- > The elisp interface should fit on a single page. (It is a bit messy as it
- > seems that the (only?) C-primitive ring_bell[_hook] is called within a few
- > built-in defuns: play-sound-file play-sound ding)
-
- But since it's called indirectly from cmd_error, there are interrupt issues
- involved: it would be hard to make running arbitrary lisp code from the error
- handler work. You'd have to run that code with interrupts off, and would
- probably have GC protection problems as well.
-
- > Furthermore, lemacs will (hopefully soon) become a full X-client which
- > requires the sound to "travel" as well.
-
- I don't know quite what you mean by "full X client," but I think lemacs is
- one... As you know, X has nothing to say about sound. (I guess you could
- say it keeps quiet on the issue...)
-
- -- Jamie
-