emacs-devel
[Top][All Lists]
Advanced

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

Re: jit-lock timer etc.


From: Chong Yidong
Subject: Re: jit-lock timer etc.
Date: Thu, 24 Aug 2006 15:48:14 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

martin rudalics <address@hidden> writes:

>  I don't know what was wrong with this code since you didn't post it.
>> It looks like you simply forgot to initialize jit-lock-stealth-repeat-timer,
>> but I can't be sure.
>
> As suggested by rms for his resume timer I did in `jit-lock-mode':
>
>        (when (and jit-lock-stealth-time (null jit-lock-stealth-timer))
>          (setq jit-lock-stealth-timer
>                (run-with-idle-timer jit-lock-stealth-time t
>                                     'jit-lock-stealth-fontify)))
>        (when (and jit-lock-stealth-time (null jit-lock-stealth-repeat-timer))
>          (setq jit-lock-stealth-repeat-timer (timer-create))
>          (timer-set-function jit-lock-stealth-repeat-timer
>                              'jit-lock-stealth-fontify t))

Now I know why your code didn't work.  The very last line is wrong!
It should be

  (timer-set-function jit-lock-stealth-repeat-timer
                      'jit-lock-stealth-fontify '(t)))

I believe that with this change, everything will work.

(Now that you mention it, it is slightly cleaner to reuse the
repeat-timer than to create a new one each time.)




reply via email to

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