Answers:
这是我每天早晨都会使用的方法,以梳理所有待办事项,如果过期,则将日期更改为今天,如果今天到期,则将其从下一动作更改为活动。这是我使用了一年的日历的自定义解决方案,因此毫无疑问需要您自己进行一些自定义。我的回忆是,有一个变化org-deadline
,从org-mode
第7版和8,我可以用我的设置以前的版本。当前版本可能需要其他参数或其他内容-如果您需要其他帮助,请告诉我,我会在接下来的几天内继续处理。
我使用的正则表达式考虑到标题有两个星号,将位于缓冲区的左对齐位置。您自己的设置可能需要修改正则表达式。
(defun org-carry-forward-uncompleted-tasks ()
"Carry forward uncompleted tasks."
(interactive)
(save-excursion
(goto-char (point-max))
(while (re-search-backward "^\\*\\* Active" nil t)
(unless (org-at-heading-p)
(org-back-to-heading t))
(let* (
(element (org-element-at-point))
(todo-state (org-element-property :todo-keyword element))
(deadline (org-element-property :deadline element))
(deadline-time-stamp
(when deadline
(time-to-days
(org-time-string-to-time
(org-element-property :raw-value deadline)))))
(today (time-to-days (current-time))) )
(when
(and
deadline-time-stamp
(> today deadline-time-stamp) ;; deadline is overdue
(string= todo-state "Active") ) ;; todo-state equals "X"
(org-deadline nil ".") )))))
(defun org-make-active-today ()
"Change task from Next Action to Active if deadline is less than or equal to today."
(interactive)
(save-excursion
(goto-char (point-max))
(while (re-search-backward "^\\*\\* Next Action" nil t)
(unless (org-at-heading-p)
(org-back-to-heading t))
(let* (
(element (org-element-at-point))
(todo-state (org-element-property :todo-keyword element))
(deadline (org-element-property :deadline element))
(deadline-time-stamp
(when deadline
(time-to-days
(org-time-string-to-time
(org-element-property :raw-value deadline) ))))
(today (time-to-days (current-time))) )
(when
(and
deadline-time-stamp
(>= today deadline-time-stamp) ;; deadline less than or equal to today
(string= todo-state "Next Action")) ;; todo-state equals "X"
(org-deadline nil ".")
(org-todo "Active") )))))