From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Nested sit-for's Date: Mon, 21 Aug 2006 12:14:18 -0400 Message-ID: <87r6zaf4ym.fsf-monnier+emacs@gnu.org> References: <87y7tp90i1.fsf@stupidchicken.com> <87hd0bjvoi.fsf@furball.mit.edu> <44E493E0.5000205@gmx.at> <44E58248.7020202@gmx.at> <87irknqzpv.fsf@furball.mit.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156176959 10546 80.91.229.2 (21 Aug 2006 16:15:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Aug 2006 16:15:59 +0000 (UTC) Cc: rudalics@gmx.at, cyd@stupidchicken.com, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 21 18:15: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 1GFCQu-00016r-Sw for ged-emacs-devel@m.gmane.org; Mon, 21 Aug 2006 18:15:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GFCQu-0006cq-5R for ged-emacs-devel@m.gmane.org; Mon, 21 Aug 2006 12:15:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GFCPu-0005tA-R7 for emacs-devel@gnu.org; Mon, 21 Aug 2006 12:14:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GFCPt-0005rb-7n for emacs-devel@gnu.org; Mon, 21 Aug 2006 12:14:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GFCPs-0005rI-NQ for emacs-devel@gnu.org; Mon, 21 Aug 2006 12:14:20 -0400 Original-Received: from [12.46.53.131] (helo=alfajor) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GFCXI-0000Ic-0L; Mon, 21 Aug 2006 12:22:00 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 31A2B1C159; Mon, 21 Aug 2006 12:14:18 -0400 (EDT) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Mon, 21 Aug 2006 13:45:06 +0200") 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:58647 Archived-At: >> IIUC, the recent addition of current-idle-time by RMS was supposed to >> fix the sit-for in jit-lock problem in a different way. But so far, >> RMS' changes to jit-lock have not been installed... What's up??? >> >> Someone else proposed a different change to the same part of jit-lock, >> and I have not had time (while sufficiently alert) to study that, >> so I don't have any idea which solution is better. >> >> I sent my changes to the list yesterday; what do others think about >> them? > I haven't fully understood either of the two approaches, but Martin's > approach which completely avoids using sit-for in the timer handler > looks vastly superior to me for that reason alone! I think we could clean up the code even more by extending run-with-idle-timer as follows: (run-with-idle-timer SECS REPEAT FUNCTION &rest ARGS) Perform an action the next time Emacs is idle for SECS seconds. The action is to call function with arguments ARGS. SECS may be an integer or a floating point number. If REPEAT is non-nil, do the action each time Emacs has been idle for exactly SECS seconds (that is, only once for each time Emacs becomes idle). Additionally, if REPEAT is a number, repeat the action every REPEAT seconds as long as Emacs stays idle. This function returns a timer object which you can use in `cancel-timer'. -- Stefan