[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How to improve Org startup time?
From: |
Sebastien Vauban |
Subject: |
Re: [O] How to improve Org startup time? |
Date: |
Thu, 14 Feb 2013 21:46:11 +0100 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.91 (windows-nt) |
Hi Memnon,
Memnon Anon wrote:
> "Sebastien Vauban" 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.
That's another way of thinking out of the box.
> 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 ...
Not in my habits, as I more often use S-up than C-c C-s. OK, one could argue
that if I move a timestamp from one day (or more), there is certainly no hours
attached to it. Rigth. But a bit fragile.
In fact, not in general, as it happens sometimes that I type the keyword
SCHEDULED by hand.
And, in fact, your code would be called (much) more often than if the
org-agenda-to-appt is called when saving an Org agenda file, what was the
solution of Tassilo. Do you see drawbacks in his solution?
Best regards,
Seb
--
Sebastien Vauban