Morgan Smith <morgan.j.sm...@outlook.com> writes: > I would like to add some features to org-habit (something I have tried > unsuccessfully in the past). Before I do that, I would like to switch > org-habit over to the org-element api. Before I do that, I would like to > extend org-element to support the org-habit syntax. > > Let me know what you think! All the tests pass on my machine.
This is a welcome addition. Thanks! Please also add etc/ORG-NEWS entry - it is org-element API change. In addition to changes in Org git, you also need to update https://orgmode.org/worg/org-syntax.html#Timestamps and https://orgmode.org/worg/dev/org-element-api.html (the page source is at https://git.sr.ht/~bzg/worg) > + (string-match > + > "\\([.+]?\\+\\)\\([0-9]+\\)\\([hdwmy]\\)/?\\([0-9]+\\)?\\([hdwmy]\\)?" This will match timestamps like <2012-03-29 Thu +1y2y>. You may instead use shy group \(?:...\)? around the whole /2y regexp match. (Or even rewrite the regexp via rx for better readability, while we are on it). > + (let ((deadline-value (org-element-property > :repeater-deadline-value timestamp)) > + (deadline-unit (org-element-property > :repeater-deadline-unit timestamp))) This is slightly confusing, because "deadline" has multiple meanings in Org. repeater-deadline-value/unit would be more readable as the variable name. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>