From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: How to improve Org startup time? Date: Thu, 14 Feb 2013 21:46:11 +0100 Message-ID: <86ip5u62uk.fsf@somewhere.org> References: <867gmviujs.fsf@somewhere.org> <87txpzoagt.fsf@bzg.ath.cx> <86d2wndo4x.fsf@somewhere.org> <874nhyab4s.fsf@bzg.ath.cx> <86sj5iwb62.fsf@somewhere.org> <86d2wltlx8.fsf@somewhere.org> <87mwvp2bd3.fsf@bzg.ath.cx> <868v793ph5.fsf@somewhere.org> <87621uhmsz.fsf@mean.albasani.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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