emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How to improve Org startup time?


From: Memnon Anon
Subject: Re: [O] How to improve Org startup time?
Date: Thu, 14 Feb 2013 17:52:24 +0000 (UTC)

"Sebastien Vauban"
<address@hidden> writes:
> Bastien wrote:
>> "Sebastien Vauban" writes:
>>
>>> However, I've left it in the `org-finalize-agenda-hook' hook, so that the
>>> `appt-list' is fed up as soon as I begin using agenda functions.
>>
>> But then org-agenda-to-appt will be called each time your generate
>> a new agenda... not sure you really want this right.
>>
>> Why not simply calling it interactively when you need it?
>
> I can't count on myself to do it at a regular enough interval (at least
> daily).
>
> Then, this is the only (?) solution found so that the appt-list is still quite
> up-to-date.

I am using the same setup (thanks Bernt :):
- Initialize on Startup
- Update on midnight for next day with run-at-time
- Update frequently via org-finalize-agenda-hook

The last piece eats up quite some time (couple of seconds on my ancient
machine), so what about a different solution just for the last bit. 
E.g., updating, when an item gets scheduled/timestamped for today.

Something like (pseudo code!):

(defadvice org-schedule (after my-adv-update-appt activate)
  "org-agenda-to-appt when org-last-timestamp todayp"
  (when (= (time-to-days 
             (org-time-string-to-time org-last-inserted-timestamp))
            (org-today))

    (message "Updating appt!")
    (org-agenda-to-appt)))

(defadvice org-time-stamp (after my-adv-update-appt activate)
  "org-agenda-to-appt when org-last-timestamp todayp"
  (when (= (time-to-days 
             (org-time-string-to-time org-last-inserted-timestamp))
            (org-today))

    (message "Updating appt!")
    (org-agenda-to-appt)))

Would that work?
I agree, calling it interactively feels error prone and I would probably
forget it ... 

Memnon




reply via email to

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