"Jacob S. Gordon" <[email protected]> writes:

> On 2026-05-10 07:02, Ihor Radchenko wrote:
>> This assumes that all the instances of filtered/invisible entry are
>> really hidden. Do we really need to make such assumption?
>
> IUUC ‘(not (invisible-p …))’ should be used instead to respect
> ‘buffer-invisibility-spec’.

This is right. I initially made that small amendment myself, but then
saw that the invisibility check is only done once.

> ... Or, are you referring to the fact that I
> only check visibility of the closest overlay?

The latter.

> ... In my testing I couldn’t
> come up with a scenario where only some of the clocking overlays were
> hidden,

There is currently no such scenario. But there is nothing stopping some
future agenda filters from applying filters to certain days only. So,
I'd prefer something more future-proof that does not rely on
undocumented state of affairs.

> ... but I can check inside the loop:
>
> (sort (remq nil (delete-dups
>                  (mapcar (lambda (o)
>                            (when-let* ((_ (eq (overlay-get o 'type)
>                                               'org-agenda-clocking))
>                                        (start (overlay-start o))
>                                        (_ (not (invisible-p start))))
>                              start))
>                          (overlays-in (point-min) (point-max)))))
>       :key (lambda (p) (count-lines p pt t)))

Yup, something like that.

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