Earl Chase <[email protected]> writes:

> I think that `org-get-repeat' should be deprecated.
> `org-auto-repeat-maybe' only uses it once, just to validate that a
> headline/inlinetask has a valid repeater. `org-habit-parse-todo' was
> the only other function that used it. As you know, org-habit has also
> started transitioning to the org-element api and already no longer
> uses `org-get-repeat'. My plan was to write a seperate function that
> uses the org-element api to parse a headline/inlinetasks and all of
> its contents, ignoring any subheaders. That function would be used by
> another function that would get all of the repeaters of a
> headline/inlinetask. But as is, the `org-get-repeat' call in
> `org-auto-repeat-maybe' isn't necessary since we can already validate
> repeaters with the org-element API.

org-get-repeat is an API function that is used in multiple other
third-party packages. So, we should keep it.
We can change implementation, of course.

> But one of the other things I
> would like to ask is why does `org-auto-repeat-maybe' have a while
> loop in the first place? Is it common for people to have multiple
> repeaters for a single header? Even so, we know exactly where
> timestamps with repeaters will appear: in the title of a headline,
> planning items, or in the section underneath a headline. So, it would
> not be difficult to rewrite the function so that it checks those
> specific places and updates the repeaters that it finds. That's one of
> the other things I was working on. I was clearly a little too
> ambitious with this patch, which is why I ran out of time without a
> real solution for inlinetasks.

Consider a task with multiple active timestamp to schedule monthly
activity happening on 1st, 5th, and 20th date of each month.
Each timestamp can be assigned a +1m repeater.
Then, marking task done will automatically shift time for all the timestamps.

>> I gave up when I saw that org-entry-put explicitly ignores inlinetasks.
>
> Isn't this something that could be replaced by the org-element api as well?

It can be.
But the problem I am referring to is more conceptual.
org-entry-put *in principle* edits headings, even when called from
inside inlinetasks. I could not change this convention without further
cascading breakage of logic across Org.

-- 
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>

Reply via email to