Merge branch 'maint'
This commit is contained in:
commit
fd5a4f7d36
|
@ -3549,7 +3549,12 @@ beginning position."
|
|||
"Parse time stamp at point.
|
||||
|
||||
Return a list whose CAR is `timestamp', and CDR a plist with
|
||||
`:type', `:begin', `:end', `:value' and `:post-blank' keywords.
|
||||
`:type', `:raw-value', `:year-start', `:month-start',
|
||||
`:day-start', `:hour-start', `:minute-start', `:year-end',
|
||||
`:month-end', `:day-end', `:hour-end', `:minute-end',
|
||||
`:repeater-type', `:repeater-value', `:repeater-unit',
|
||||
`:warning-type', `:warning-value', `:warning-unit', `:begin',
|
||||
`:end', `:value' and `:post-blank' keywords.
|
||||
|
||||
Assume point is at the beginning of the timestamp."
|
||||
(save-excursion
|
||||
|
@ -3579,7 +3584,7 @@ Assume point is at the beginning of the timestamp."
|
|||
(t 'inactive)))
|
||||
(repeater-props
|
||||
(and (not diaryp)
|
||||
(string-match "\\([.+]?\\+\\)\\([0-9]+\\)\\([hdwmy]\\)>"
|
||||
(string-match "\\([.+]?\\+\\)\\([0-9]+\\)\\([hdwmy]\\)"
|
||||
raw-value)
|
||||
(list
|
||||
:repeater-type
|
||||
|
@ -3591,6 +3596,15 @@ Assume point is at the beginning of the timestamp."
|
|||
:repeater-unit
|
||||
(case (string-to-char (match-string 3 raw-value))
|
||||
(?h 'hour) (?d 'day) (?w 'week) (?m 'month) (t 'year)))))
|
||||
(warning-props
|
||||
(and (not diaryp)
|
||||
(string-match "\\(-\\)?-\\([0-9]+\\)\\([hdwmy]\\)" raw-value)
|
||||
(list
|
||||
:warning-type (if (match-string 1 raw-value) 'first 'all)
|
||||
:warning-value (string-to-number (match-string 2 raw-value))
|
||||
:warning-unit
|
||||
(case (string-to-char (match-string 3 raw-value))
|
||||
(?h 'hour) (?d 'day) (?w 'week) (?m 'month) (t 'year)))))
|
||||
year-start month-start day-start hour-start minute-start year-end
|
||||
month-end day-end hour-end minute-end)
|
||||
;; Parse date-start.
|
||||
|
@ -3627,7 +3641,8 @@ Assume point is at the beginning of the timestamp."
|
|||
:begin begin
|
||||
:end end
|
||||
:post-blank post-blank)
|
||||
repeater-props)))))
|
||||
repeater-props
|
||||
warning-props)))))
|
||||
|
||||
(defun org-element-timestamp-interpreter (timestamp contents)
|
||||
"Interpret TIMESTAMP object as Org syntax.
|
||||
|
@ -3643,6 +3658,15 @@ CONTENTS is nil."
|
|||
(and val (number-to-string val)))
|
||||
(case (org-element-property :repeater-unit timestamp)
|
||||
(hour "h") (day "d") (week "w") (month "m") (year "y"))))
|
||||
(warning-string
|
||||
(concat
|
||||
(and (eq (org-element-property :warninger-type timestamp) 'first)
|
||||
"-")
|
||||
"-"
|
||||
(let ((val (org-element-property :warninger-value timestamp)))
|
||||
(and val (number-to-string val)))
|
||||
(case (org-element-property :warninger-unit timestamp)
|
||||
(hour "h") (day "d") (week "w") (month "m") (year "y"))))
|
||||
(build-ts-string
|
||||
;; Build an Org timestamp string from TIME. ACTIVEP is
|
||||
;; non-nil when time stamp is active. If WITH-TIME-P is
|
||||
|
|
|
@ -1921,11 +1921,21 @@ Outside list"
|
|||
(let ((timestamp (org-element-context)))
|
||||
(or (org-element-property :hour-end timestamp)
|
||||
(org-element-property :minute-end timestamp)))))
|
||||
;; With repeater.
|
||||
;; With repeater, warning delay and both.
|
||||
(should
|
||||
(eq 'catch-up
|
||||
(org-test-with-temp-text "<2012-03-29 Thu ++1y>"
|
||||
(org-element-property :repeater-type (org-element-context)))))
|
||||
(should
|
||||
(eq 'first
|
||||
(org-test-with-temp-text "<2012-03-29 Thu --1y>"
|
||||
(org-element-property :warning-type (org-element-context)))))
|
||||
(should
|
||||
(equal '(cumulate all)
|
||||
(org-test-with-temp-text "<2012-03-29 Thu +1y -1y>"
|
||||
(let ((ts (org-element-context)))
|
||||
(list (org-element-property :repeater-type ts)
|
||||
(org-element-property :warning-type ts))))))
|
||||
;; Timestamps are not planning elements.
|
||||
(should-not
|
||||
(org-test-with-temp-text "SCHEDULED: <2012-03-29 Thu 16:40>"
|
||||
|
|
Loading…
Reference in New Issue