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: Sebastien Vauban
Subject: Re: [O] How to improve Org startup time?
Date: Thu, 14 Feb 2013 11:24:02 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.93 (windows-nt)

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




reply via email to

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