From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: No sound with Emacs 23.1.1 on Ubuntu 9.10 Date: Mon, 04 Jan 2010 12:03:20 -0600 Message-ID: References: <52d2aa65-9365-4b84-a651-23027d482f8e@21g2000vbh.googlegroups.com> <97mdnTbYRIuvC6PWnZ2dnUVZ_tNi4p2d@sysmatrix.net> <3690201d-0aa7-4d44-80e9-bbb7916bf6d7@h10g2000vbm.googlegroups.com> <3NudnRfAMrPgrtzWnZ2dnUVZ_jmdnZ2d@sysmatrix.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1262710322 23382 80.91.229.12 (5 Jan 2010 16:52:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jan 2010 16:52:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 05 17:51:55 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NSCca-0005wk-7P for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Jan 2010 17:51:04 +0100 Original-Received: from localhost ([127.0.0.1]:45855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSCca-0006Gw-Rs for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Jan 2010 11:51:04 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!cgl.ucsf.edu!newsfeed.berkeley.edu!ucberkeley!news.svpal.org!xmission!news.glorb.com!news2.glorb.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Mon, 04 Jan 2010 12:03:11 -0600 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) Original-Newsgroups: gnu.emacs.help In-Reply-To: X-No-Archive: yes Original-Lines: 81 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 12.73.132.211 Original-X-Trace: sv3-5nKtTd6kKqyyypfy+ks2hXwaE9rmgG+JMvRLiMRVi2yX3YPUqVbl0UanwlKAnCeS91+qUAK2DimdSV1!S/LgTlbG2VtnQF45OFa7KXrNQVzRhUsGoHCmVmJLOy0oOQyVlrt83TIZP5bMHtA3upY/gS4AgaPP!DXRKJ1AWR0L1y4c/PbacvjHHmwhnoQ4= Original-X-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: news.stanford.edu gnu.emacs.help:175986 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-Gmane-Expiry: 2010-01-19 Xref: news.gmane.org gmane.emacs.help:71065 Archived-At: B. T. Raven wrote: > B. T. Raven wrote: >> Joe Casadonte wrote: >>> On Jan 1, 7:41 pm, "B. T. Raven" wrote: >>> >>>> If you position cursor after >>>> >>>> (ding) >>>> >>>> in *scratch* and evaluate with >>>> >>>> C-x C-e do you hear anything? >>> Sadly -- nothing. >> Maybe your Ubuntu build didn't have this in term.c for some reason: >> >> DEFVAR_LISP ("ring-bell-function", &Vring_bell_function, >> doc: /* Non-nil means call this function to ring the bell. >> The function should accept no arguments. */); >> Vring_bell_function = Qnil; >> >> If this variable names some function then maybe the problem is with that >> function. >> >> I tried to write a countdown timer in elisp once but could't get the >> bell, C-g or char 7, to work in a loop; it would only ring once when the >> counter went to zero. This is all it does now: >> >> (defun alarm-message (text) >> "Pop up alarm message" >> (ding) >> (message-box text)) > > > This puts ding in a 30 per minute loop that can't be broken out of: > > (defun alarm-message (text) > "Pop up alarm message" > (ding) > (read-event) > (while (waiting-for-user-input-p) > (sleep-for 2) > (ding) > ) > (message-box text) > ) > > I had to kill the emacs process to escape from this. What's going on here? > > >> >> (defun alarm () >> "Set an alarm. >> The time format is the same accepted by `run-at-time'. For >> example \"11:30am\"." >> (interactive) >> (let ((time (read-string "Time: ")) >> (text "Get lead out!")) >> (run-at-time time nil 'alarm-message text))) >> >> Does any of you know how to get (ding) to work in a loop that breaks >> when a key is pressed? >> >> Ed >> >> Replacing alarm-message with this sort of works, in case anyone is interested: (defun alarm-message (text) "Pop up alarm message" (while (not (read-char nil nil 1)) (sleep-for 2) (ding) ) (message-box text) ) The number of more elegant solutions is probably legion.