Earl Chase <[email protected]> writes:

> Did not realize this. I now confirm that we are at a headline before
> parsing. I also moved this down closer to the code that actually uses it.

> -     (let ((scheduled (org-entry-get (point) "SCHEDULED")))
> -       (when (and scheduled (not (string-match-p org-repeat-re scheduled)))
> +     (let* ((headline (save-match-data
> +                           (save-excursion
> +                             (if (org-at-heading-p)
> +                                 (org-element-headline-parser)
> +                               (progn
> +                                 (org-back-to-heading t)
> +                                 (org-element-headline-parser))))))

That's very awkward way to do it.
You can simply use org-element-lineage + org-element-at-point.

> +           (when (equal repeater-unit `week)
> +                (setq repeater-value (* repeater-value 7)
> +                      repeater-unit "d"))

Maybe (setq repeater-unit 'day)?

I assume that this problem was not caught in the tests.
We need more tests accompanying this change.

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