From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: jit-lock timer etc. Date: Thu, 24 Aug 2006 15:07:42 +0200 Message-ID: References: <44E9E5F5.8000400@gmx.at> <87fyfpq5wf.fsf@stupidchicken.com> <44EA3222.9050405@gmx.at> <44EC49AD.2080001@gmx.at> <44ED9A3E.3050001@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156424977 19391 80.91.229.2 (24 Aug 2006 13:09:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 Aug 2006 13:09:37 +0000 (UTC) Cc: cyd@stupidchicken.com, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 24 15:09:31 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 1GGExV-0001it-9t for ged-emacs-devel@m.gmane.org; Thu, 24 Aug 2006 15:09:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGExU-0005PC-Qu for ged-emacs-devel@m.gmane.org; Thu, 24 Aug 2006 09:09:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GGExB-0005E5-Hm for emacs-devel@gnu.org; Thu, 24 Aug 2006 09:09:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GGEx9-0005BB-PD for emacs-devel@gnu.org; Thu, 24 Aug 2006 09:09:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGEx9-0005Ao-IO for emacs-devel@gnu.org; Thu, 24 Aug 2006 09:08:59 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GGF5C-0006EM-Hp; Thu, 24 Aug 2006 09:17:18 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepc.post.tele.dk (Postfix) with SMTP id 7B65E8A0050; Thu, 24 Aug 2006 15:08:57 +0200 (CEST) Original-To: martin rudalics In-Reply-To: <44ED9A3E.3050001@gmx.at> (martin rudalics's message of "Thu, 24 Aug 2006 14:23:26 +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:58806 Archived-At: martin rudalics writes: >> With the latest version of current-idle-time, this now becomes: >> >> >> (when (and jit-lock-stealth-buffers jit-lock-stealth-time) >> ;; Call us again. >> (let ((idle (current-idle-time))) >> (when idle >> (timer-set-idle-time jit-lock-stealth-repeat-timer idle) >> (timer-inc-time jit-lock-stealth-repeat-timer delay) >> (timer-activate-when-idle jit-lock-stealth-repeat-timer t))) >> >> [I swapped idle and delay args back again, as using floats DTRT] >> >> It can't get much simpler than that! >> > > It still doesn't trigger. With > > (when (and jit-lock-stealth-buffers jit-lock-stealth-time) > ;; Call us again. > (let ((message-log-max t) > (count 0)) > (let ((idle (current-idle-time))) > (message "idle ... %s" idle) > (when idle > (message "%s ... %s" (setq count (1+ count)) jit-lock-stealth-repeat-timer) > (timer-set-idle-time jit-lock-stealth-repeat-timer idle) > (message "%s ... %s" (setq count (1+ count)) jit-lock-stealth-repeat-timer) > (timer-inc-time jit-lock-stealth-repeat-timer (max delay 0.1)) > (message "%s ... %s" (setq count (1+ count)) jit-lock-stealth-repeat-timer) > (timer-activate-when-idle jit-lock-stealth-repeat-timer t) > (message "%s ... %s" (setq count (1+ count)) jit-lock-stealth-repeat-timer))))) > It seems that reusing the idle timer is broken. This seems to work: (let ((idle (current-idle-time))) (when idle (run-with-idle-timer (+ idle (max delay 0.1)) nil #'jit-lock-stealth-fontify))) -- Kim F. Storm http://www.cua.dk