Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display custom agenda-view on Emacs startup?

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?
like image 776
robust Avatar asked May 07 '14 20:05

robust


1 Answers

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.

like image 65
Dan Avatar answered Oct 18 '22 05:10

Dan