How can I show the Org-mode agenda on Emacs start-up?
This works for me (in .emacs
):
(setq inhibit-splash-screen t)
(org-agenda-list)
(delete-other-windows)
Without the first line, the splash screen "covered" the agenda; without the third one, the scratch buffer remained visible.
One alternative to the hook is to set the initial-buffer-choice
variable. This is particularly useful if there are multiple buffers or a number of functions on the hook. The function on this variable needs to return a buffer. Naively this might be:
(setq initial-buffer-choice (lambda ()
(org-agenda-list 1)
(get-buffer "*Org Agenda*")))
You can use after-init-hook
to run a piece of code after initialization has finished. To run (org-agenda-list)
after init, use:
(add-hook 'after-init-hook 'org-agenda-list)