Ihor Radchenko <yanta...@gmail.com> writes:

>          However, org-cycle-hide-drawers might be called in
> isearch-open-invisible-temporary.

This callback receives two arguments:
- the overlay which contains a match,
- whether we are un-hiding the overlay's span or hiding it back.

To get the same behaviour as Org≤9.3, IIUC we want to do the following:

1. When isearch asks us to un-hide,
    1. go over all drawers within the overlay,
    2. hide those that do not contain a match, by adding an
       invisible overlay.

2. When isearch asks us to hide back,
    1. remove the invisible overlays we have put on these drawers.

1.1. is straightforward: overlay-start and overlay-end tell us where to
look for drawers.

1.2. stumps me: is there an isearch API I can use while in the callback
to know where the matches are located?

For 2.1, I guess we will need to cache the temporary invisible overlays
we add during step 1. in a global list; that way when it's time to
destroy them, we can simply iterate on the list?

(Sorry for being so slow 😕 I never seem to be able to spend more than
10 minutes on this issue before having to switch to something else…)

Reply via email to