【问题标题】:org-timer module load error in emacsemacs 中的 org-timer 模块加载错误
【发布时间】:2011-09-21 22:39:22
【问题描述】:

我想在 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 时,Warnings 缓冲区中会显示以下警告。

Symbol's value as variable is void: org-modules

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

如何摆脱错误。

【问题讨论】:

    标签: emacs elisp org-mode


    【解决方案1】:

    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 可以处理尚未定义的变量,但add-to-list 不能。你可以写(setq org-modules '(org-timer)),但这会覆盖默认模块列表而不是添加到它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-08
      • 1970-01-01
      • 2012-01-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多