emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jit-lock timer etc.


From: Kim F. Storm
Subject: Re: jit-lock timer etc.
Date: Thu, 24 Aug 2006 15:07:42 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

martin rudalics <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]