Earl Chase <[email protected]> writes: > This is an attempt to get `org-auto-repeat-maybe' to use the org-element > API. Because this function relies heavily on match-data and seems to be > intertwined with `org-timestamp-change', half of the function still does > not use org-element API. My goal was just to prepare this function for a > bigger and more complete refactor. > From 2d397b6a6c1b835bcad5697470beeca3f939fd6c Mon Sep 17 00:00:00 2001 > From: ApollonDeParnasse <[email protected]> > Date: Wed, 1 Jul 2026 17:44:58 -0500 > Subject: [PATCH] lisp/org.el: Transition `org-auto-repeat-maybe' to > org-element API > > * lisp/org.el (org-auto-repeat-maybe): Use org-element > API to get repeater data for timestamps.
Thanks! > + (headline (save-match-data (org-element-at-point))) Not that this function may be called with point inside heading. Then, org-element-at-point may not return the heading itself, but may return some element inside. > + (let* ((match-point (match-beginning 0)) > + (curr-element (save-match-data (save-excursion > + (goto-char match-point) > + > (org-element-timestamp-parser)))) This will always attempt to parse a timestamp. > + (planningp (org-element-type-p curr-element 'planning)) So, this will always be nil. -- Ihor Radchenko // yantar92, Org mode maintainer, 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>
