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: Fri, 11 Aug 2006 17:00:18 -0400 Message-ID: <87bqqr6l99.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 1155329970 8985 80.91.229.2 (11 Aug 2006 20:59:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 11 Aug 2006 20:59:30 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 11 22:59:28 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 1GBe6G-000748-PY for ged-emacs-devel@m.gmane.org; Fri, 11 Aug 2006 22:59:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GBe6G-0005X2-AW for ged-emacs-devel@m.gmane.org; Fri, 11 Aug 2006 16:59:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GBe63-0005SF-1g for emacs-devel@gnu.org; Fri, 11 Aug 2006 16:59:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GBe5z-0005N0-QZ for emacs-devel@gnu.org; Fri, 11 Aug 2006 16:59:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GBe5z-0005Mc-BN for emacs-devel@gnu.org; Fri, 11 Aug 2006 16:59:07 -0400 Original-Received: from [18.19.1.138] (helo=cyd) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GBeBC-0000yS-Cg for emacs-devel@gnu.org; Fri, 11 Aug 2006 17:04:30 -0400 Original-Received: by cyd (Postfix, from userid 1000) id E18B94EB9E; Fri, 11 Aug 2006 17:00:18 -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:58301 Archived-At: Noah Friedman writes: > The less simple solution is probably for sit-for to go back to using > a timer itself. The reason for not using a timer is so that when a process filter runs during the sit-for, the expiry of the sit-for won't interrupt the filter (which might be waiting for keyboard input). Otherwise, process filters can't reliably call input reading functions. See the thread labelled "a bug of read-passwd" from July. > One solution to this problem is to bind timer-idle-list to nil while > calling read-event. This would inhibit all other idle timers from running during the sit-for. But jit-lock-stealth-fontify, for example, sits for 30 seconds, and I don't think we want to inhibit other idle timers during this entire period. > The problem is that read-event's call tree ultimately results in > calling keyboard.c:read_char, which calls timer_start_idle. This > resets the activation time for all the current idle timer events, > which means that any function on an idle timer which calls sit-for > is now getting scheduled to be run recursively if another interval > of the appropriate length ensues. I think the solution is to avoid calling timer_start_idle when read-event is given a non-nil SECONDS argument. What do people think?