Question

I have

(add-hook 'after-init-hook 'org-agenda)

in my init file. This displays the agenda dispatcher. How can I

  1. automatically display a custom view (shortcut "w")
  2. make sure the agenda view is the only window and there is no *scratch* buffer in a second window?
Was it helpful?

Solution

This should work:

(add-hook 'after-init-hook (lambda () (org-agenda nil "w")))

@robust: you can get more information through the help page for using org-agenda non-interactively (C-h f org-agenda); note that the original (interactive) in the lambda was unneeded, so I edited it out. The first optional argument is the prefix argument so pass it a placeholder, but the second (ORG-KEYS) is the one you want to set to your key of interest ("w"). You wrap the call to org-agenda in a lambda, which is self-quoting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top