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 15:47:07 -0400 Message-ID: <87odun6qx0.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 1155584779 15905 80.91.229.2 (14 Aug 2006 19:46:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Aug 2006 19:46:19 +0000 (UTC) Cc: emacs-devel@gnu.org, Noah Friedman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 14 21:46:17 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 1GCiNy-0007vZ-Ae for ged-emacs-devel@m.gmane.org; Mon, 14 Aug 2006 21:46:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GCiNx-00068H-Q5 for ged-emacs-devel@m.gmane.org; Mon, 14 Aug 2006 15:46:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GCiNl-00068C-Sa for emacs-devel@gnu.org; Mon, 14 Aug 2006 15:45:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GCiNj-00067Z-G4 for emacs-devel@gnu.org; Mon, 14 Aug 2006 15:45:52 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GCiNj-00067O-9x for emacs-devel@gnu.org; Mon, 14 Aug 2006 15:45:51 -0400 Original-Received: from [18.19.1.138] (helo=cyd) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GCiTb-0002VE-0c; Mon, 14 Aug 2006 15:51:55 -0400 Original-Received: by cyd (Postfix, from userid 1000) id 7EF604E2D1; Mon, 14 Aug 2006 15:47:07 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Mon, 14 Aug 2006 15:20:49 -0400") 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:58392 Archived-At: > Why do these timer functions call sit-for? It is a strange thing for > a timer to wait. It should reschedule itself instead. What are they > really trying to do? It varies from situation to situation. For example, jit-lock uses the idle timer function jit-lock-stealth-fontify, which calls sit-for. The goal, in that case, is to wait a certain amount of time between fontifying chunks. > 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? > > That is definitely not right. Emacs really is idle when it reads an event, > even if there is a timeout. > > So my conclusion is that when read-event is called from an idle timer, > it should not change the state to idle at the beginning, and it should > not change the state away from idle at the end. > > Does this change fix it? I already checked in a different change to keyboard.c before your email came in. But I think your version makes more sense.