I have a quite extensive org-agenda-files, so the first time I load an agenda view after starting the Emacs process, I have to wait ~20sec. I'm using Emacs in daemon mode (via systemd user service).

How can I have Emacs initialize the org-agenda on daemon startup, so that once I'm in Emacs, I don't have to wait when displaying an agenda for the first time?

3 Answers 3


Add this to your .emacs:

(add-hook 'after-init-hook 'org-agenda-list)
  • doesn't work. Emacs startup is "quick" as ever, and the first time I want to display an agenda, I need to wait for all my agenda files to be loaded.
    – andreas-h
    Apr 30, 2016 at 7:02
  • It works for me. Check if you are defer loading or if your packages are not being loaded properly. Trace debug your init file loading to see if you notice any errors.
    – Emacs User
    Apr 30, 2016 at 13:49

To make this work with emacsclient (and with a regular session also) you can use a focus-in-hook instead of the after-init-hook in Emacs User his answer. To make the agenda show your agenda items also, you should set your agenda-file/directory before setting the hook.

(setq org-agenda-files (quote ("agenda-directory")))

This has been covered before: https://stackoverflow.com/questions/2010539/how-can-i-show-the-org-mode-agenda-on-emacs-start-up

The top answer on that occasion was the answer posted by Emacs User.

  • That doesn't change the fact that his answer doesn't work for my current config.
    – andreas-h
    May 3, 2016 at 5:20
  • Sorry - I think I missed the daemon part. I've not tested, but would setting org-agenda-sticky to t help in conjunction with the after-init-hook mentioned above? This keeps agenda buffers persistent so, if it exists, it's just redisplayed when requested (and so is pretty instant). You can then always press "g" to refresh the displayed agenda if it's too out of date. May 16, 2016 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.