You can even schedule and deadline:
- m\n8|**** TODO Learning from Data Week %(+ x 2) \nSCHEDULED: <%(t-date "Oct 7" (* x 7))> DEADLINE: <%(t-date "Oct 14" (* x 7))>
+ m\n8|**** TODO Learning from Data Week %(+ x 2) \nSCHEDULED: <%(date "Oct 7" (* x 7))> DEADLINE: <%(date "Oct 14" (* x 7))>
**** TODO Learning from Data Week 2
SCHEDULED: <2013-10-07 Mon> DEADLINE: <2013-10-14 Mon>
;; 2744:196:14
;; 3375:225:15
;; 4096:256:16"))
- (should (equal (with-text-value "m\\n8|**** TODO Learning from Data Week %(+ x 2)\\nSCHEDULED: <%(t-date \"Oct 7\" (* x 7))> DEADLINE: <%(t-date \"Oct 14\" (* x 7))>"
+ (should (equal (with-text-value "m\\n8|**** TODO Learning from Data Week %(+ x 2)\\nSCHEDULED: <%(date \"Oct 7\" (* x 7))> DEADLINE: <%(date \"Oct 14\" (* x 7))>"
(lambda()(eval (read (tiny-mapconcat)))))
"**** TODO Learning from Data Week 2
SCHEDULED: <2013-10-07 Mon> DEADLINE: <2013-10-14 Mon>
SCHEDULED: <2013-11-25 Mon> DEADLINE: <2013-12-02 Mon>
**** TODO Learning from Data Week 10
SCHEDULED: <2013-12-02 Mon> DEADLINE: <2013-12-09 Mon>"))
- (should (string= (with-text-value "m\\n4|**** TODO Classical Mechanics Week %(+ x 5)\\nSCHEDULED: <%(t-date \"Oct 15\" (* x 7))> DEADLINE: <%(t-date \"Oct 23\" (* x 7))>"
+ (should (string= (with-text-value "m\\n4|**** TODO Classical Mechanics Week %(+ x 5)\\nSCHEDULED: <%(date \"Oct 15\" (* x 7))> DEADLINE: <%(date \"Oct 23\" (* x 7))>"
(lambda()(eval (read (tiny-mapconcat)))))
"**** TODO Classical Mechanics Week 5
SCHEDULED: <2013-10-15 Tue> DEADLINE: <2013-10-23 Wed>
;; m1\n10listx+x96|convert img%s.jpg -monochrome -resize 50%% -rotate 180 img%c_mono.pdf
;; m1\n10listxnthxfoo-list|convert img%s.jpg -monochrome -resize 50%% -rotate 180 img%c_mono.pdf
;; m\n;; 16list*xxx)*xx%s:%s:%s
-;; m\n8|**** TODO Learning from Data Week %(+ x 2) \nSCHEDULED: <%(t-date "Oct 7" (* x 7))> DEADLINE: <%(t-date "Oct 14" (* x 7))>
+;; m\n8|**** TODO Learning from Data Week %(+ x 2) \nSCHEDULED: <%(date "Oct 7" (* x 7))> DEADLINE: <%(date "Oct 14" (* x 7))>
;;
;; As you might have guessed, the syntax is as follows:
;; m[<range start:=0>][<separator:= >]<range end>[lisp expr]|[format expr]
(incf beg (length fexp))
(destructuring-bind (sexp . end)
(read-from-string str beg)
- (push (substring str beg end) forms)
+ (push
+ (replace-regexp-in-string "(date" "(tiny-date"
+ (substring str beg end))
+ forms)
(setq str (concat (substring str 0 beg)
(if (string= fexp "%") "s" "")
(substring str end)))))
(apply #'concat (nreverse out))
(make-string n-paren ?\)))))))
-(defun t-date (s &optional shift)
+(defun tiny-date (s &optional shift)
(let ((time (apply 'encode-time
(org-read-date-analyze
s nil