org-element: Fix timestamp interpreter

* lisp/org-element.el (org-element-timestamp-interpreter): Fix
  timestamp interpreter when raw value isn't available.
* testing/lisp/test-org-element.el: Update test.
This commit is contained in:
Nicolas Goaziou 2012-11-25 01:03:51 +01:00
parent b7053b5f9c
commit a51b8fa308
2 changed files with 9 additions and 5 deletions

View File

@ -3562,10 +3562,13 @@ CONTENTS is nil."
(and hour-start minute-start)
(and time-range-p hour-end)
(and time-range-p minute-end)
(concat (case (org-element-property :repeater-type timestamp)
(cumulate "+") (catch-up "++") (restart ".+"))
(org-element-property :repeater-value timestamp)
(org-element-property :repeater-unit timestamp)))))
(concat
(case (org-element-property :repeater-type timestamp)
(cumulate "+") (catch-up "++") (restart ".+"))
(let ((val (org-element-property :repeater-value timestamp)))
(and val (number-to-string val)))
(case (org-element-property :repeater-unit timestamp)
(hour "h") (day "d") (week "w") (month "m") (year "y"))))))
((active-range inactive-range)
(let ((minute-start (org-element-property :minute-start timestamp))
(minute-end (org-element-property :minute-end timestamp))

View File

@ -2251,7 +2251,8 @@ DEADLINE: <2012-01-01> SCHEDULED: <2012-01-01> CLOSED: [2012-01-01]\n"))))
(org-element-timestamp-interpreter
'(timestamp
(:type active :year-start 2012 :month-start 3 :day-start 29
:repeater-type cumulate :repeater-value "1y")) nil))))
:repeater-type cumulate :repeater-value 1 :repeater-unit year))
nil))))
(ert-deftest test-org-element/verse-block-interpreter ()
"Test verse block interpretation."