From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: sit-for and idle timers Date: Mon, 14 Aug 2006 14:34:49 -0400 Message-ID: <871wrjkvxy.fsf@stupidchicken.com> References: <20060811124841.840381.FMU5696@piglet.prv.splode.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1155580438 748 80.91.229.2 (14 Aug 2006 18:33:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Aug 2006 18:33:58 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 14 20:33:57 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GChFy-0001hF-41 for ged-emacs-devel@m.gmane.org; Mon, 14 Aug 2006 20:33:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GChFx-0007SA-KT for ged-emacs-devel@m.gmane.org; Mon, 14 Aug 2006 14:33:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GChFm-0007Rw-L6 for emacs-devel@gnu.org; Mon, 14 Aug 2006 14:33:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GChFk-0007Rk-VX for emacs-devel@gnu.org; Mon, 14 Aug 2006 14:33:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GChFk-0007Rh-Pg for emacs-devel@gnu.org; Mon, 14 Aug 2006 14:33:32 -0400 Original-Received: from [18.19.1.138] (helo=cyd) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GChLc-0005B1-FJ for emacs-devel@gnu.org; Mon, 14 Aug 2006 14:39:36 -0400 Original-Received: by cyd (Postfix, from userid 1000) id 553D04E2D1; Mon, 14 Aug 2006 14:34:49 -0400 (EDT) Original-To: Noah Friedman In-Reply-To: <20060811124841.840381.FMU5696@piglet.prv.splode.com> (Noah Friedman's message of "Fri, 11 Aug 2006 12:48:41 -0700 (PDT)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58387 Archived-At: Noah Friedman writes: > The change to sit-for of 2006-07-26 ("Use new SECONDS arg of read-event > instead of a timer") seems to cause problems with idle-timers > which call sit-for. This should now be fixed. > Here's a small test case which demonstrates the problem: > > (defvar itimer-test-wait 0.5) > (defvar itimer-test-depth 0) > > (defun itimer-test () > (setq itimer-test-depth (1+ itimer-test-depth)) > (unwind-protect > (let ((flag nil)) > (while (sit-for itimer-test-wait) > (setq flag (not flag)) > (message "itimer-test-depth: %-3d%s" > itimer-test-depth > (if flag " (blink)" "")))) > (setq itimer-test-depth (1- itimer-test-depth)) > (message "itimer-test-depth: %d" itimer-test-depth))) > > (run-with-idle-timer 0.25 t 'itimer-test) > > In the pre-7/26 implementation, this timer should never print a depth > greater than 1, and the "(blink)" text should blink on and off with a > regular rhythm.