Idle functions

Julien Danjou julien at danjou.info
Fri Oct 22 05:31:16 EDT 2010


On Fri, Oct 22 2010, Stephen J. Turnbull wrote:

> What does current-idle-timer do?

It returns the time since when Emacs is idle, or nil if it's not idle.

>  > run-with-idle-timer is not usable because it only run once by idle
>  > session.
>
> ;; probably you want to wrap this up in a macro and use a gensym
> ;; instead of a global symbol
> (defvar timer-foo-timer nil)
> (defun timer-foo ()
>   (do-foo)
>   (when (itimerp timer-foo-timer) (delete-itimer itimer-foo-timer))
>   (setq timer-foo-timer (run-with-idle-timer secs nil #'timer-foo)))

I don't think this will work. Or it's not secs, but rather
(+ secs (current-time)), isn't it?
And with that I'm not sure it's really realiable, is it?

Thanks Stephen,

-- 
Julien Danjou
// ᐰ <julien at danjou.info>   http://julien.danjou.info


More information about the XEmacs-Beta mailing list