如何在 Emacs 启动时显示 Org 模式议程?
我希望当我打开 Emacs 时 Org 模式议程能够自动显示我今天要做的事情。 org-agenda 命令是交互式的,因此它似乎不太适合此目的。
有没有办法在 Emacs 启动时显示 Org 模式议程?
谢谢,
康纳
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您可以使用
after-init-hook
在初始化完成后运行一段代码。要在 init 后运行(org-agenda-list)
,请使用:You can use
after-init-hook
to run a piece of code after initialization has finished. To run(org-agenda-list)
after init, use:这对我有用(在
.emacs
中):没有第一行,启动屏幕“覆盖”了议程;如果没有第三个,暂存缓冲区仍然可见。
This works for me (in
.emacs
):Without the first line, the splash screen "covered" the agenda; without the third one, the scratch buffer remained visible.
挂钩的一种替代方法是设置
initial-buffer-choice
变量。如果挂钩上有多个缓冲区或多个函数,这尤其有用。该变量上的函数需要返回一个缓冲区。天真地这可能是: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:尝试
(org-agenda-list)
。如果您只想今天,(org-agenda-list 1)
。当然,apropos 是你的朋友。
Ch Ca org-agenda
(或任何命令)将向您显示有关该命令的有用信息。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.我有一个 bash 别名来启动 emacs 并打开议程:
别名 org='/usr/bin/emacs --funcall org-agenda-list &'
享受吧
。
I have a bash alias to start emacs with the Agenda open:
alias org='/usr/bin/emacs --funcall org-agenda-list &'
Enjoy.
这并不完全是在启动时,但我让 Emacs 保持运行,所以我需要一种不同的方法
感谢 https://stackoverflow.com/a/ 14947354/217408
It is not exactly at startup, but I keep Emacs running so I need a different approach
Credits to https://stackoverflow.com/a/14947354/217408
当 emacs 守护进程创建客户端时,您可以使用
server-after-make-frame-hook
运行任何命令 -这对我来说非常适合,因为每当我打开 emacsclient 时,就会出现 org 议程,这正是我想要。
如果以下钩子更适合您的需求,您还可以查看它们-
https://www.gnu.org/software/ emacs/manual/html_node/elisp/Standard-Hooks.html
You can use the
server-after-make-frame-hook
to run any command when the emacs daemon creates a client-This works perfectly for me because whenever I open emacsclient, org agenda appears which is exactly what I wanted.
You can also look at the following hooks if they suit your needs more-
https://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Hooks.html