我阅读了组织模式手册,但找不到简单的方法将CREATED字段添加到新创建的TODO中。然后结合org-log-done
可以计算出关闭特定TODO所需的时间。在使用存档文件时,这尤其有用。
例:
* TODO Do something
CREATED: [2012-09-02 Sun 23:02]
* DONE Do something else
CREATED: [2012-09-02 Sun 20:02]
CLOSED: [2012-09-02 Sun 22:02]
每当文件保存时,我希望CREATED字段会添加到新任务(没有该字段的任务)中。
关于如何实现这一目标的任何建议?使用Git之类的方法并不是跟踪TODOS创作的解决方案。
最佳答案
我使用org-expiry来实现该功能,该功能位于org的contrib目录中。
我使用的基本配置是:
;; Allow automatically handing of created/expired meta data.
(require 'org-expiry)
;; Configure it a bit to my liking
(setq
org-expiry-created-property-name "CREATED" ; Name of property when an item is created
org-expiry-inactive-timestamps t ; Don't have everything in the agenda view
)
(defun mrb/insert-created-timestamp()
"Insert a CREATED property using org-expiry.el for TODO entries"
(org-expiry-insert-created)
(org-back-to-heading)
(org-end-of-line)
(insert " ")
)
;; Whenever a TODO entry is created, I want a timestamp
;; Advice org-insert-todo-heading to insert a created timestamp using org-expiry
(defadvice org-insert-todo-heading (after mrb/created-timestamp-advice activate)
"Insert a CREATED property using org-expiry.el for TODO entries"
(mrb/insert-created-timestamp)
)
;; Make it active
(ad-activate 'org-insert-todo-heading)
如果您使用的是捕获功能,它将无法自动运行,并且需要一点胶水。我已经在此处发布了完整的配置:https://gist.github.com/4037694
关于emacs - 在组织模式下将CREATED date属性添加到TODO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12262220/