How can I show the Org-mode agenda on Emacs start-up?

自古美人都是妖i 提交于 2019-12-20 09:47:52

问题


I would like the Org-mode agenda to automatically show what I have to do today when I open Emacs. The org-agenda command is interactive, so it doesn't seem to work well for this purpose.

Is there a way to show the Org-mode agenda on Emacs start-up?

Thanks,

Conor


回答1:


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)



回答2:


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.




回答3:


Try (org-agenda-list). If you just want today, (org-agenda-list 1).

And of course, apropos is your friend. C-h C-a org-agenda (or whatever command) will show you useful info on that command.




回答4:


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*")))    



回答5:


I have a bash alias to start emacs with the Agenda open:

alias org='/usr/bin/emacs --funcall org-agenda-list &'

Enjoy.



来源:https://stackoverflow.com/questions/2010539/how-can-i-show-the-org-mode-agenda-on-emacs-start-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!