diff options
author | Ihor Radchenko <yantar92@posteo.net> | 2024-01-08 13:33:59 +0100 |
---|---|---|
committer | Ihor Radchenko <yantar92@posteo.net> | 2024-05-03 13:42:06 +0300 |
commit | 5da0eb6ea77742bb8dbff82d105f79e829eaa415 (patch) | |
tree | 9c1440945bd2dd67549b6aed28dd0b22dbde3568 /etc | |
parent | 1cafe3e8e496637b7ae0f6ed0dee22891b39627f (diff) |
org-element-timestamp-parser: Allow time in diary sexp timestamps
* lisp/org-agenda.el (org-agenda-get-timestamps):
* lisp/org-element.el (org-element--timestamp-regexp): Adjust
timestamp regexp.
(org-element-timestamp-parser): Support the new syntax for diary sexp
timestamps. The diary sexp is now stored in :diary-sexp property and
the time/time range is stored as usual.
(org-element-timestamp-interpreter): Interpret diary timestamp
according to its building blocks rather than raw value.
* testing/lisp/test-org-agenda.el (test-org-agenda/diary-timestamp):
New test checking for agenda support of times in diary timestamps.
*
testing/lisp/test-org-element.el (test-org-element/timestamp-interpreter):
Add parser tests.
* doc/org-manual.org (Timestamps): Add an example of the new syntax to
the manual.
* etc/ORG-NEWS (Diary type timestamps now support optional
time/timerange): Document the Org syntax addition.
This syntax modification is fixing an omission in org-element.el. In
the past, org-agenda had explicit support for diary timestamps with
time/timerange, but that support was ad-hoc. Now, after org-agenda
switched to use parser, we must modify Org syntax to fix the feature
regression.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/ORG-NEWS | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 87ebed751..99dd8839c 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -339,7 +339,43 @@ Now, ~org-store-link~ moves the stored link to front of the list of stored links. This way, the link will show up first in the completion and when inserting all the stored links with ~org-insert-all-links~. -*** Major changes and additions to Org API +*** Major changes and additions to Org element API +**** Diary type timestamps now support optional time/timerange + +Previously, diary type timestamps could not specify time. +Now, it is allowed to add a time or time range: + +: <%%(diary-float t 4 2) 22:00-23:00> +: <%%(diary-float t 4 2) 10:30> + +The parsed representation of such timestamps will have ~:hour-start~, +~:minute-start~, ~:hour-end~, ~:minute-end~, and ~:range-type~ +properties set appropriately. In addition, a new ~:diary-sexp~ +property will store the diary sexp value. + +For example, + +: <%%(diary-float t 4 2) 22:00-23:00> + +will have the following properties + +#+begin_src emacs-lisp +:type: diary +:range-type: timerange +:raw-value: "<%%(diary-float t 4 2) 22:00-23:00>" +:year-start: nil +:month-start: nil +:day-start: nil +:hour-start: 22 +:minute-start: 0 +:year-end: nil +:month-end: nil +:day-end: nil +:hour-end: 23 +:minute-end: 0 +:diary-sexp: "(diary-float t 4 2)" +#+end_src + **** New term: "syntax node" To reduce confusion with "element" referring to both "syntax element" |