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 11:24:02 +0100 Message-ID: <8638wzchx9.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> <878v6ri6nu.fsf@thinkpad.tsdh.de> 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 Tassilo, Tassilo Horn wrote: > "Sebastien Vauban" writes: > >>> 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 call it once at emacs startup I don't do it anymore, for not requiring Org libraries anymore, would I simply fire up an Emacs for non-Org tasks (such as reading my mails with Gnus). > and then only when I save an agenda file. Pretty smart alternative (instead of doing it at every agenda build)... > (defun th-org-agenda-to-appt () > (org-agenda-to-appt t) > (appt-activate 1)) Why re-activating appt each time? Why not simply once in your .emacs? > (defun th-org-mode-init () > ;; ... > (when (and (org-agenda-file-p) > (not (string= (file-name-nondirectory (buffer-file-name)) > org-mobile-capture-file)) > (not (string= (buffer-file-name) > org-mobile-inbox-for-pull))) > (add-hook 'after-save-hook 'th-org-agenda-to-appt t t))) > > (add-hook 'org-mode-hook 'th-org-mode-init) *I* don't understand why you put the addition to `after-save-hook' inside a complex when about some type of file. Your `after-save-hook' is global, right? Would something like the following not be sufficient -- eventually put in an `(eval-after-load "org")'...? #+begin_src emacs-lisp (add-hook 'after-save-hook (lambda () (when (and (eq major-mode 'org-mode) (org-agenda-file-p)) (org-agenda-to-appt)))) #+end_src Best regards, Seb -- Sebastien Vauban