|
From: | martin rudalics |
Subject: | Re: jit-lock timer etc. |
Date: | Thu, 24 Aug 2006 14:23:26 +0200 |
User-agent: | Mozilla Thunderbird 1.0 (Windows/20041206) |
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))))) I get idle ... 3.02 1 ... [t nil nil nil nil jit-lock-stealth-fontify t nil] 2 ... [t 0 3 20000 nil jit-lock-stealth-fontify t nil] 3 ... [t 0 3 120000 nil jit-lock-stealth-fontify t nil] 4 ... [nil 0 3 120000 nil jit-lock-stealth-fontify t t] idle ... 3.02 1 ... [t 0 3 120000 nil jit-lock-stealth-fontify t t] 2 ... [t 0 3 20000 nil jit-lock-stealth-fontify t t] 3 ... [t 0 3 120000 nil jit-lock-stealth-fontify t t] 4 ... [nil 0 3 120000 nil jit-lock-stealth-fontify t t] idle ... 3.02 1 ... [t 0 3 120000 nil jit-lock-stealth-fontify t t] 2 ... [t 0 3 20000 nil jit-lock-stealth-fontify t t] 3 ... [t 0 3 120000 nil jit-lock-stealth-fontify t t] 4 ... [nil 0 3 120000 nil jit-lock-stealth-fontify t t] idle ... 3.02 1 ... [t 0 3 120000 nil jit-lock-stealth-fontify t t] 2 ... [t 0 3 20000 nil jit-lock-stealth-fontify t t] 3 ... [t 0 3 120000 nil jit-lock-stealth-fontify t t] 4 ... [nil 0 3 120000 nil jit-lock-stealth-fontify t t] hence `current-idle-time' always returns the same value.
[Prev in Thread] | Current Thread | [Next in Thread] |