Advanced date handling for scheduled tasks in org-mode
This is not my code - upstream is here: https://github.com/chenfengyuan/elisp/blob/master/next-spec-day.el
I simply created this repo to make it easy to use in emacs for myself.
- add
(load "/path/to/next-spec-day")
to your dot emacs file. - set
NEXT-SPEC-DEADLINE
and/orNEXT-SPEC-SCHEDULED
property of a TODO task,like this:* TODO test SCHEDULED: <2013-06-16 Sun> DEADLINE: <2012-12-31 Mon -3d> :PROPERTIES: :NEXT-SPEC-DEADLINE: (= (calendar-extract-day date) (calendar-last-day-of-month (calendar-extract-month date) (calendar-extract-year date))) :NEXT-SPEC-SCHEDULED: (org-float 6 0 3) :END:
The value of
NEXT-SPEC-DEADLINE
will returnnon-nil
ifdate
is last day of month,and the value ofNEXT-SPEC-SCHEDULED
will returnnon-nil
ifdate
is the fathers’ day (the third Sunday of June). - Then, when you change the TODO state of that tasks,the timestamp will be changed automatically (include lead time of warnings settings).
Notes
- Execute
(setq next-spec-day-runningp nil)
after your sexp signal some errors, - You can also use some useful sexp from next-spec-day-alist,like:
* TODO test SCHEDULED: <2013-03-29 Fri> :PROPERTIES: :NEXT-SPEC-SCHEDULED: last-workday-of-month :END:
- If you encounter some errors like ‘org-insert-time-stamp: Wrong type argument: listp, “<2013-03-29 Mon>”’ when changing the TODO state, please try a new version of org mode. To use the new version: