gpt4 book ai didi

emacs - emacs 中的 org-timer 模块加载错误

转载 作者:行者123 更新时间:2023-12-04 11:29:17 25 4
gpt4 key购买 nike

我想在 org-mode 中使用番茄钟技术,如
http://orgmode.org/worg/org-gtd-etc.html

我在 .emacs 文件中添加了以下几行

(add-to-list 'org-modules 'org-timer)

(setq org-timer-default-timer 25)

(add-hook 'org-clock-in-hook '(lambda ()
(if (not org-timer-current-timer)
(org-timer-set-timer '(16)))))

启动 emacs 时,警告缓冲区中会显示以下警告。
Symbol's value as variable is void: org-modules

我正在使用从 git://orgmode.org/org-mode.git 克隆的 org-mode 版本 - 7.7.291.g37db

如何摆脱错误。

最佳答案

org-modulesorg.el 中定义.如果要向列表中添加元素,则需要等到定义变量(使用默认列表)。一种方法是将添加延迟到 org.el 之后。已加载:

(defun my-after-load-org ()
(add-to-list 'org-modules 'org-timer))
(eval-after-load "org" '(my-after-load-org))

请注意 add-hook可以处理尚 undefined variable ,但 add-to-list不能。你可以写 (setq org-modules '(org-timer)) ,但这会覆盖默认模块列表而不是添加到它。

关于emacs - emacs 中的 org-timer 模块加载错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7507584/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com