emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Scaling org-mode


From: Nick Dokos
Subject: Re: [Orgmode] Scaling org-mode
Date: Sun, 13 Sep 2009 12:52:58 -0400

Dave Täht <address@hidden> wrote:

> ...
> so thought 2) would be to have it only attempt to construct background
> agendas when the system is otherwise idle for a few minutes. I don't
> know how to do that, I figure wrapping this bit with something that
> could detect idleness instead of just running arbitrarily would be good.
> 
>   (run-at-time nil 3600 'org-agenda-to-appt)
> 
> don't know how to detect idleness.
> 

[Apologies if this is off-topic - I haven't read your message carefully,
as I was catching up on email between jobs.]

Not sure whether it'll work any better, but there is run-with-idle-timer.
C-h f run-with-idle-timer <RET> says:

,----
| run-with-idle-timer is an interactive compiled Lisp function in
| `timer.el'.
| 
| (run-with-idle-timer SECS REPEAT FUNCTION &rest ARGS)
| 
| Perform an action the next time Emacs is idle for SECS seconds.
| The action is to call FUNCTION with arguments ARGS.
| SECS may be an integer, a floating point number, or the internal
| time format (HIGH LOW USECS) returned by, e.g., `current-idle-time'.
| If Emacs is currently idle, and has been idle for N seconds (N < SECS),
| then it will call FUNCTION in SECS - N seconds from now.
| 
| If REPEAT is non-nil, do the action each time Emacs has been idle for
| exactly SECS seconds (that is, only once for each time Emacs becomes idle).
| 
| This function returns a timer object which you can use in `cancel-timer'.
`----


HTH,
Nick




reply via email to

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